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
Merge requests
!526
Add TC_DASHMODE color shader
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add TC_DASHMODE color shader
dashmode-shader
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Lach
requested to merge
dashmode-shader
into
master
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
4
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
8a70759e
1 commit,
5 years ago
1 file
+
33
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/hardware/hw_md2.c
+
33
−
0
Options
@@ -729,6 +729,39 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
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
{
while
(
size
--
)
Loading