From 603eb89ca2962073a052fc97b6cfa24f1a237409 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Sat, 27 May 2023 18:03:33 +0100 Subject: [PATCH] We flood-fill model skins for compat with vanilla glquake. Turns out glquake had a bug that causes it to only floodfill skin 0, rather than all (non-group) skins, and our behaviour was making hexen2 compat noticably worse. --- engine/common/com_mesh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/common/com_mesh.c b/engine/common/com_mesh.c index 275f9b4cf..e44b96b4e 100644 --- a/engine/common/com_mesh.c +++ b/engine/common/com_mesh.c @@ -3782,7 +3782,7 @@ static void Mod_FloodFillSkin( qbyte *skin, int skinwidth, int skinheight ) int filledcolor = -1; int i; - if (dpcompat_nofloodfill.ival) + if (dpcompat_nofloodfill.ival || skinwidth > 0x7fffu || skinheight > 0x7fffu) return; if (filledcolor == -1) @@ -3856,7 +3856,8 @@ static void *Q1MDL_LoadSkins_GL (galiasinfo_t *galias, dmdl_t *pq1inmodel, model saved = (qbyte*)(frames+1); frames[0].texels = saved; memcpy(saved, pskintype+1, s); - Mod_FloodFillSkin(saved, outskin->skinwidth, outskin->skinheight); + if (i == 0) //Vanilla bug: ONLY skin 0 is flood-filled (the vanilla code operates on a cached 'skin' variable that does NOT get updated between skins reflooding skin 0). We still don't like flood fills either. Hexen2 has the same issue. + Mod_FloodFillSkin(saved, outskin->skinwidth, outskin->skinheight); } else {