From e2b6ebec91a81bb4fb57f85fd7e43c9c6eff45fb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Nov 2020 23:59:04 +0100 Subject: [PATCH] - partially fixed colorization for hires replacements. --- source/core/palette.cpp | 1 + source/core/textures/hightile.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/core/palette.cpp b/source/core/palette.cpp index eb8ae9d7a..a5c256f41 100644 --- a/source/core/palette.cpp +++ b/source/core/palette.cpp @@ -408,6 +408,7 @@ void LookupTableInfo::setPaletteTint(int palnum, int r, int g, int b, int sr, in auto &lookup = tables[palnum]; lookup.tintColor = PalEntry(r, g, b); lookup.tintShade = PalEntry(sr, sg, sb); + if (flags == 0) flags = TINTF_COLORIZE; lookup.tintFlags = flags | TINTF_ENABLE; } diff --git a/source/core/textures/hightile.cpp b/source/core/textures/hightile.cpp index eb0d2080d..12c7f1549 100644 --- a/source/core/textures/hightile.cpp +++ b/source/core/textures/hightile.cpp @@ -314,7 +314,7 @@ int tileSetSkybox(int picnum, int palnum, const char **facenames, int flags ) static bool PickTexture(FGameTexture* tex, int paletteid, TexturePick& pick) { if (!tex->isValid() || tex->GetTexelWidth() <= 0 || tex->GetTexelHeight() <= 0) return false; - int usepalette = GetTranslationType(paletteid) - Translation_Remap; + int usepalette = paletteid == 0? 0 : GetTranslationType(paletteid) - Translation_Remap; int usepalswap = GetTranslationIndex(paletteid); int TextureType = hw_int_useindexedcolortextures? TT_INDEXED : TT_TRUECOLOR; @@ -339,7 +339,8 @@ static bool PickTexture(FGameTexture* tex, int paletteid, TexturePick& pick) { tex = rep->faces[0]; } - if (!rep || rep->palnum != usepalswap || (h.tintFlags & TINTF_APPLYOVERALTPAL)) applytint = true; + if (!rep || rep->palnum != usepalswap || (h.tintFlags & TINTF_APPLYOVERALTPAL)) + applytint = true; pick.translation = 0; } else