Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
c415d80e
Commit
c415d80e
authored
5 years ago
by
James R.
Browse files
Options
Downloads
Plain Diff
Merge branch 'dashmode-shader' into 'master'
Add TC_DASHMODE color shader See merge request
!526
parents
d64a7def
8a70759e
Loading
Loading
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hardware/hw_md2.c
+33
-0
33 additions, 0 deletions
src/hardware/hw_md2.c
with
33 additions
and
0 deletions
src/hardware/hw_md2.c
+
33
−
0
View file @
c415d80e
...
@@ -729,6 +729,39 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
...
@@ -729,6 +729,39 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
cur
++
;
image
++
;
blendimage
++
;
cur
++
;
image
++
;
blendimage
++
;
}
}
}
}
else
if
(
skinnum
==
TC_DASHMODE
)
{
while
(
size
--
)
{
if
(
image
->
s
.
alpha
==
0
&&
blendimage
->
s
.
alpha
==
0
)
{
// Don't bother with blending the pixel if the alpha of the blend pixel is 0
cur
->
rgba
=
image
->
rgba
;
}
else
{
UINT8
ialpha
=
255
-
blendimage
->
s
.
alpha
,
balpha
=
blendimage
->
s
.
alpha
;
RGBA_t
icolor
=
*
image
,
bcolor
;
if
(
blendimage
->
s
.
alpha
)
{
bcolor
.
s
.
blue
=
0
;
bcolor
.
s
.
red
=
255
;
bcolor
.
s
.
green
=
(
blendimage
->
s
.
red
+
blendimage
->
s
.
green
+
blendimage
->
s
.
blue
)
/
3
;
}
if
(
image
->
s
.
alpha
&&
image
->
s
.
red
>
image
->
s
.
green
<<
1
)
// this is pretty arbitrary, but it works well for Metal Sonic
{
icolor
.
s
.
red
=
image
->
s
.
blue
;
icolor
.
s
.
blue
=
image
->
s
.
red
;
}
cur
->
s
.
red
=
(
ialpha
*
icolor
.
s
.
red
+
balpha
*
bcolor
.
s
.
red
)
/
255
;
cur
->
s
.
green
=
(
ialpha
*
icolor
.
s
.
green
+
balpha
*
bcolor
.
s
.
green
)
/
255
;
cur
->
s
.
blue
=
(
ialpha
*
icolor
.
s
.
blue
+
balpha
*
bcolor
.
s
.
blue
)
/
255
;
cur
->
s
.
alpha
=
image
->
s
.
alpha
;
}
cur
++
;
image
++
;
blendimage
++
;
}
}
else
else
{
{
while
(
size
--
)
while
(
size
--
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment