From 775eabcd3d09b78fecd2d9a018938d244de54b66 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Jul 2020 17:56:33 +0200 Subject: [PATCH] - fixed incorrect 'twodonly' flag set for the base palettes. This let the palette creator skip all translations for the water and slime palette. Fixes #28. --- source/core/textures/buildtiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/core/textures/buildtiles.cpp b/source/core/textures/buildtiles.cpp index 516a311a7..28b6c0f8a 100644 --- a/source/core/textures/buildtiles.cpp +++ b/source/core/textures/buildtiles.cpp @@ -1013,11 +1013,11 @@ bool PickTexture(int picnum, FGameTexture* tex, int paletteid, TexturePick& pick pick.translation = TRANSLATION(usepalette + Translation_Remap, usepalswap); pick.basepalTint = 0xffffff; - auto& h = lookups.tables[palette]; + auto& h = lookups.tables[usepalswap]; bool applytint = false; // Canvas textures must be treated like hightile replacements in the following code. if (picnum < 0) picnum = TileFiles.GetTileIndex(tex); // Allow getting replacements also when the texture is not passed by its tile number. - auto rep = (picnum >= 0 && hw_hightile && !(h.tintFlags & TINTF_ALWAYSUSEART)) ? TileFiles.FindReplacement(picnum, palette) : nullptr; + auto rep = (picnum >= 0 && hw_hightile && !(h.tintFlags & TINTF_ALWAYSUSEART)) ? TileFiles.FindReplacement(picnum, usepalswap) : nullptr; if (rep || tex->GetTexture()->isHardwareCanvas()) { if (usepalette != 0) @@ -1032,7 +1032,7 @@ bool PickTexture(int picnum, FGameTexture* tex, int paletteid, TexturePick& pick { tex = rep->faces[0]; } - if (!rep || rep->palnum != palette || (h.tintFlags & TINTF_APPLYOVERALTPAL)) applytint = true; + if (!rep || rep->palnum != usepalswap || (h.tintFlags & TINTF_APPLYOVERALTPAL)) applytint = true; pick.translation = 0; } else