mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 20:20:54 +00:00
- fixed hires replacement code not to destroy the intended translation in case there is no replacement.
This commit is contained in:
parent
c08583ebc1
commit
7b72fccfa2
1 changed files with 5 additions and 4 deletions
|
@ -318,7 +318,6 @@ static bool PickTexture(FGameTexture* tex, int paletteid, TexturePick& pick)
|
||||||
int usepalette = paletteid == 0? 0 : GetTranslationType(paletteid) - Translation_Remap;
|
int usepalette = paletteid == 0? 0 : GetTranslationType(paletteid) - Translation_Remap;
|
||||||
int usepalswap = GetTranslationIndex(paletteid);
|
int usepalswap = GetTranslationIndex(paletteid);
|
||||||
int TextureType = hw_int_useindexedcolortextures? TT_INDEXED : TT_TRUECOLOR;
|
int TextureType = hw_int_useindexedcolortextures? TT_INDEXED : TT_TRUECOLOR;
|
||||||
if (usepalette < 0) usepalette = usepalswap = 0; // this is not a lookup-based translation so ignore it.
|
|
||||||
|
|
||||||
pick.translation = paletteid;
|
pick.translation = paletteid;
|
||||||
pick.basepalTint = 0xffffff;
|
pick.basepalTint = 0xffffff;
|
||||||
|
@ -326,10 +325,12 @@ static bool PickTexture(FGameTexture* tex, int paletteid, TexturePick& pick)
|
||||||
auto& h = lookups.tables[usepalswap];
|
auto& h = lookups.tables[usepalswap];
|
||||||
bool applytint = false;
|
bool applytint = false;
|
||||||
// Canvas textures must be treated like hightile replacements in the following code.
|
// Canvas textures must be treated like hightile replacements in the following code.
|
||||||
auto rep = (hw_hightile && !(h.tintFlags & TINTF_ALWAYSUSEART)) ? FindReplacement(tex->GetID(), usepalswap, false) : nullptr;
|
|
||||||
|
int hipalswap = usepalette >= 0 ? usepalswap : 0;
|
||||||
|
auto rep = (hw_hightile && !(h.tintFlags & TINTF_ALWAYSUSEART)) ? FindReplacement(tex->GetID(), hipalswap, false) : nullptr;
|
||||||
if (rep || tex->GetTexture()->isHardwareCanvas())
|
if (rep || tex->GetTexture()->isHardwareCanvas())
|
||||||
{
|
{
|
||||||
if (usepalette != 0)
|
if (usepalette > 0)
|
||||||
{
|
{
|
||||||
// This is a global setting for the entire scene, so let's do it here, right at the start. (Fixme: Store this in a static table instead of reusing the same entry for all palettes.)
|
// This is a global setting for the entire scene, so let's do it here, right at the start. (Fixme: Store this in a static table instead of reusing the same entry for all palettes.)
|
||||||
auto& hh = lookups.tables[MAXPALOOKUPS - 1];
|
auto& hh = lookups.tables[MAXPALOOKUPS - 1];
|
||||||
|
@ -341,7 +342,7 @@ static bool PickTexture(FGameTexture* tex, int paletteid, TexturePick& pick)
|
||||||
{
|
{
|
||||||
tex = rep->faces[0];
|
tex = rep->faces[0];
|
||||||
}
|
}
|
||||||
if (!rep || rep->palnum != usepalswap || (h.tintFlags & TINTF_APPLYOVERALTPAL))
|
if (!rep || rep->palnum != hipalswap || (h.tintFlags & TINTF_APPLYOVERALTPAL))
|
||||||
applytint = true;
|
applytint = true;
|
||||||
pick.translation = 0;
|
pick.translation = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue