mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
- fixed: True color texture replacements were set up incorrectly.
They incorrectly set themselves up as their own glow and detail textures. These layers also weren't disabled for the next texture.
This commit is contained in:
parent
ad24a1ce31
commit
6b431cec2c
2 changed files with 13 additions and 2 deletions
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
|
#include "palette.h"
|
||||||
#include "../glbackend/gl_hwtexture.h"
|
#include "../glbackend/gl_hwtexture.h"
|
||||||
|
|
||||||
FTexture *CreateBrightmapTexture(FImageSource*);
|
FTexture *CreateBrightmapTexture(FImageSource*);
|
||||||
|
@ -413,7 +414,7 @@ HightileReplacement *FTexture::FindReplacement(int palnum, bool skybox)
|
||||||
{
|
{
|
||||||
if (rep.palnum == palnum && (rep.faces[1] != nullptr) == skybox) return &rep;
|
if (rep.palnum == palnum && (rep.faces[1] != nullptr) == skybox) return &rep;
|
||||||
}
|
}
|
||||||
if (!palnum) break;
|
if (!palnum || palnum >= MAXPALOOKUPS - RESERVEDPALS) break;
|
||||||
palnum = 0;
|
palnum = 0;
|
||||||
}
|
}
|
||||||
return nullptr; // no replacement found
|
return nullptr; // no replacement found
|
||||||
|
|
|
@ -157,6 +157,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
int usepalswap = fixpalswap >= 1 ? fixpalswap - 1 : palette;
|
int usepalswap = fixpalswap >= 1 ? fixpalswap - 1 : palette;
|
||||||
GLInterface.SetPalette(usepalette);
|
GLInterface.SetPalette(usepalette);
|
||||||
GLInterface.SetPalswap(usepalswap);
|
GLInterface.SetPalswap(usepalswap);
|
||||||
|
bool texbound[3] = {};
|
||||||
|
|
||||||
TextureType = hw_useindexedcolortextures? TT_INDEXED : TT_TRUECOLOR;
|
TextureType = hw_useindexedcolortextures? TT_INDEXED : TT_TRUECOLOR;
|
||||||
|
|
||||||
|
@ -192,6 +193,8 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
|
sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
|
||||||
}
|
}
|
||||||
else renderState.Flags &= ~RF_UsePalette;
|
else renderState.Flags &= ~RF_UsePalette;
|
||||||
|
UseDetailMapping(false);
|
||||||
|
UseGlowMapping(false);
|
||||||
UseBrightmaps(false);
|
UseBrightmaps(false);
|
||||||
|
|
||||||
BindTexture(0, mtex, sampler);
|
BindTexture(0, mtex, sampler);
|
||||||
|
@ -223,6 +226,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
auto htex = LoadTexture(det, TT_HICREPLACE, 0);
|
auto htex = LoadTexture(det, TT_HICREPLACE, 0);
|
||||||
UseDetailMapping(true);
|
UseDetailMapping(true);
|
||||||
BindTexture(3, htex, SamplerRepeat);
|
BindTexture(3, htex, SamplerRepeat);
|
||||||
|
texbound[0] = true;
|
||||||
|
|
||||||
// Q: Pass the scale factor as a separate uniform to get rid of the additional matrix?
|
// Q: Pass the scale factor as a separate uniform to get rid of the additional matrix?
|
||||||
if (MatrixChange & 1) MatrixChange |= 2;
|
if (MatrixChange & 1) MatrixChange |= 2;
|
||||||
|
@ -240,7 +244,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
{
|
{
|
||||||
if (!(method & DAMETH_MODEL))
|
if (!(method & DAMETH_MODEL))
|
||||||
{
|
{
|
||||||
auto drep = tex->FindReplacement(DETAILPAL);
|
auto drep = tex->FindReplacement(GLOWPAL);
|
||||||
if (drep)
|
if (drep)
|
||||||
{
|
{
|
||||||
glow = drep->faces[0];
|
glow = drep->faces[0];
|
||||||
|
@ -251,6 +255,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
auto htex = LoadTexture(glow, TT_HICREPLACE, 0);
|
auto htex = LoadTexture(glow, TT_HICREPLACE, 0);
|
||||||
UseGlowMapping(true);
|
UseGlowMapping(true);
|
||||||
BindTexture(4, htex, SamplerRepeat);
|
BindTexture(4, htex, SamplerRepeat);
|
||||||
|
texbound[1] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -264,6 +269,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
LoadTexture(brep->faces[0], TT_HICREPLACE, 0);
|
LoadTexture(brep->faces[0], TT_HICREPLACE, 0);
|
||||||
UseBrightmaps(true);
|
UseBrightmaps(true);
|
||||||
BindTexture(5, mtex, sampler);
|
BindTexture(5, mtex, sampler);
|
||||||
|
texbound[2] = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -285,10 +291,14 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
{
|
{
|
||||||
UseBrightmaps(true);
|
UseBrightmaps(true);
|
||||||
BindTexture(5, htex, sampler);
|
BindTexture(5, htex, sampler);
|
||||||
|
texbound[2] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!texbound[0]) UnbindTexture(3);
|
||||||
|
if (!texbound[1]) UnbindTexture(4);
|
||||||
|
if (!texbound[2]) UnbindTexture(5);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
|
Loading…
Reference in a new issue