From 89344a60232c487bd3ffbb81f7eabb62681286cd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 2 Jun 2021 21:31:38 +0200 Subject: [PATCH] - Exhumed: precache all frames of tile animations. --- source/games/exhumed/src/enginesubs.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source/games/exhumed/src/enginesubs.cpp b/source/games/exhumed/src/enginesubs.cpp index 76b570bd4..69c6c194f 100644 --- a/source/games/exhumed/src/enginesubs.cpp +++ b/source/games/exhumed/src/enginesubs.cpp @@ -42,24 +42,33 @@ void precache() for (i = 0; i < numsectors; i++) { - short j = sector[i].ceilingpicnum; + int j = sector[i].ceilingpicnum; markTileForPrecache(j, sector[i].ceilingpal); + if (picanm[j].sf & PICANM_ANIMTYPE_MASK) + for (int k = 1; k <= picanm[j].num; k++) markTileForPrecache(j + k, sector[i].ceilingpal); + j = sector[i].floorpicnum; markTileForPrecache(j, sector[i].floorpal); + if (picanm[j].sf & PICANM_ANIMTYPE_MASK) + for (int k = 1; k <= picanm[j].num; k++) markTileForPrecache(j + k, sector[i].floorpal); } for (i = 0; i < numwalls; i++) { - short j = wall[i].picnum; + int j = wall[i].picnum; markTileForPrecache(j, wall[i].pal); + if (picanm[j].sf & PICANM_ANIMTYPE_MASK) + for (int k = 1; k <= picanm[j].num; k++) markTileForPrecache(j + k, wall[i].pal); } for (i = 0; i < kMaxSprites; i++) { if (sprite[i].statnum < kMaxStatus) { - short j = sprite[i].picnum; + int j = sprite[i].picnum; markTileForPrecache(j, sprite[i].pal); + if (picanm[j].sf & PICANM_ANIMTYPE_MASK) + for (int k = 1; k <= picanm[j].num; k++) markTileForPrecache(j + k, sprite[i].pal); } } precacheMarkedTiles();