From 95b98700aebdc01fcfa6f9272da5e6f650946da2 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 14 Dec 2023 17:26:21 -0600 Subject: [PATCH] Add encoremap to textures-as-flats --- src/hardware/hw_cache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 8f007762e..474f53647 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -980,6 +980,13 @@ void HWR_GetLevelFlat(levelflat_t *levelflat, boolean noencoremap) if (!grtex->mipmap.data && !grtex->mipmap.downloaded) { HWR_CacheTextureAsFlat(&grtex->mipmap, texturenum, noencoremap); + + if (!noencoremap && encoremap) + { + grtex->mipmap.colormap = Z_Calloc(sizeof(*grtex->mipmap.colormap), PU_HWRPATCHCOLMIPMAP, NULL); + grtex->mipmap.colormap->source = colormaps + COLORMAP_REMAPOFFSET; + M_Memcpy(grtex->mipmap.colormap->data, colormaps + COLORMAP_REMAPOFFSET, 256); + } } // If hardware does not have the texture, then call pfnSetTexture to upload it