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
08794559
Commit
08794559
authored
5 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Fix TC_ blending
parent
01399c70
No related branches found
No related tags found
2 merge requests
!734
Rebase Keycodes only branch.
,
!519
OpenGL fixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hardware/hw_data.h
+1
-0
1 addition, 0 deletions
src/hardware/hw_data.h
src/hardware/hw_md2.c
+20
-12
20 additions, 12 deletions
src/hardware/hw_md2.c
with
21 additions
and
12 deletions
src/hardware/hw_data.h
+
1
−
0
View file @
08794559
...
...
@@ -48,6 +48,7 @@ struct GLMipmap_s
struct
GLMipmap_s
*
nextcolormap
;
const
UINT8
*
colormap
;
INT32
tcindex
;
// opengl
struct
GLMipmap_s
*
nextmipmap
;
// opengl : liste of all texture in opengl driver
...
...
This diff is collapsed.
Click to expand it.
src/hardware/hw_md2.c
+
20
−
12
View file @
08794559
...
...
@@ -649,7 +649,6 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
if
(
grmip
->
width
==
0
)
{
grmip
->
width
=
gpatch
->
width
;
grmip
->
height
=
gpatch
->
height
;
...
...
@@ -679,10 +678,11 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
{
if
(
skinnum
==
TC_BOSS
)
{
//
P
ur
e black turns into
white
if
(
image
->
s
.
red
==
0
&&
image
->
s
.
green
==
0
&&
image
->
s
.
blue
=
=
0
)
//
T
ur
n everything below a certain threshold
white
if
(
(
image
->
s
.
red
==
image
->
s
.
green
)
&&
(
image
->
s
.
green
==
image
->
s
.
blue
)
&&
image
->
s
.
blue
<
=
82
)
{
cur
->
s
.
red
=
cur
->
s
.
green
=
cur
->
s
.
blue
=
255
;
// Lactozilla: Invert the colors
cur
->
s
.
red
=
cur
->
s
.
green
=
cur
->
s
.
blue
=
(
255
-
image
->
s
.
blue
);
}
else
{
...
...
@@ -908,19 +908,19 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment
GLMipmap_t
*
grmip
,
*
newmip
;
if
(
colormap
==
colormaps
||
colormap
==
NULL
)
if
(
(
colormap
==
colormaps
||
colormap
==
NULL
)
&&
(
skinnum
>
TC_DEFAULT
))
{
// Don't do any blending
HWD
.
pfnSetTexture
(
gpatch
->
mipmap
);
return
;
}
// search for the mi
m
map
// search for the mi
p
map
// skip the first (no colormap translated)
for
(
grmip
=
gpatch
->
mipmap
;
grmip
->
nextcolormap
;
)
{
grmip
=
grmip
->
nextcolormap
;
if
(
grmip
->
colormap
==
colormap
)
if
(
grmip
->
colormap
==
colormap
||
grmip
->
tcindex
==
skinnum
)
{
if
(
grmip
->
downloaded
&&
grmip
->
grInfo
.
data
)
{
...
...
@@ -943,6 +943,7 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
I_Error
(
"%s: Out of memory"
,
"HWR_GetMappedPatch"
);
grmip
->
nextcolormap
=
newmip
;
newmip
->
colormap
=
colormap
;
newmip
->
tcindex
=
skinnum
;
HWR_CreateBlendedTexture
(
gpatch
,
blendgpatch
,
newmip
,
skinnum
,
color
);
...
...
@@ -1167,11 +1168,10 @@ void HWR_DrawModel(gr_vissprite_t *spr)
if
(
gpatch
&&
gpatch
->
mipmap
->
grInfo
.
format
)
// else if meant that if a texture couldn't be loaded, it would just end up using something else's texture
{
if
((
skincolors_t
)
spr
->
mobj
->
color
!=
SKINCOLOR_NONE
&&
md2
->
blendgrpatch
&&
((
GLPatch_t
*
)
md2
->
blendgrpatch
)
->
mipmap
->
grInfo
.
format
if
(
md2
->
blendgrpatch
&&
((
GLPatch_t
*
)
md2
->
blendgrpatch
)
->
mipmap
->
grInfo
.
format
&&
gpatch
->
width
==
((
GLPatch_t
*
)
md2
->
blendgrpatch
)
->
width
&&
gpatch
->
height
==
((
GLPatch_t
*
)
md2
->
blendgrpatch
)
->
height
)
{
INT32
skinnum
=
TC_DEFAULT
;
INT32
skinnum
=
INT32_MAX
;
if
((
spr
->
mobj
->
flags
&
(
MF_ENEMY
|
MF_BOSS
))
&&
(
spr
->
mobj
->
flags2
&
MF2_FRET
)
&&
!
(
spr
->
mobj
->
flags
&
MF_GRENADEBOUNCE
)
&&
(
leveltime
&
1
))
// Bosses "flash"
{
if
(
spr
->
mobj
->
type
==
MT_CYBRAKDEMON
||
spr
->
mobj
->
colorized
)
...
...
@@ -1181,7 +1181,7 @@ void HWR_DrawModel(gr_vissprite_t *spr)
else
skinnum
=
TC_BOSS
;
}
else
if
(
spr
->
mobj
->
color
)
else
if
(
(
skincolors_t
)
spr
->
mobj
->
color
!=
SKINCOLOR_NONE
)
{
if
(
spr
->
mobj
->
colorized
)
skinnum
=
TC_RAINBOW
;
...
...
@@ -1199,7 +1199,15 @@ void HWR_DrawModel(gr_vissprite_t *spr)
else
skinnum
=
TC_DEFAULT
;
}
HWR_GetBlendedTexture
(
gpatch
,
(
GLPatch_t
*
)
md2
->
blendgrpatch
,
skinnum
,
spr
->
colormap
,
(
skincolors_t
)
spr
->
mobj
->
color
);
// Translation or skin number found
if
(
skinnum
!=
INT32_MAX
)
HWR_GetBlendedTexture
(
gpatch
,
(
GLPatch_t
*
)
md2
->
blendgrpatch
,
skinnum
,
spr
->
colormap
,
(
skincolors_t
)
spr
->
mobj
->
color
);
else
{
// Sorry nothing
HWD
.
pfnSetTexture
(
gpatch
->
mipmap
);
}
}
else
{
...
...
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