From 99ab8fa7264727551020f208c121aa68f3abc793 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 14 Aug 2021 22:30:26 +1000 Subject: [PATCH] - Blood: Add interpolation repair for `kQAV2SGUNPRE` (res_id: 86). Thanks again to @Phredreeke for the tiles with overlays baked in for this to work properly. --- source/games/blood/src/qav.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/games/blood/src/qav.cpp b/source/games/blood/src/qav.cpp index 8891e2302..45bff7ede 100644 --- a/source/games/blood/src/qav.cpp +++ b/source/games/blood/src/qav.cpp @@ -1098,6 +1098,30 @@ static void qavRepairTileData(QAV* pQAV) pQAV->frames[29].tiles[1].picnum = pQAV->frames[29].tiles[3].picnum = pQAV->frames[29].tiles[6].picnum = -1; break; } + case kQAV2SGUNPRE: + { + // 2SGUNPRE's overlay sizes vary from tile to tile and don't interpolate properly. + // Use repaired tiles from Phredreeke where the overlays are baked in. + constexpr int tilearray[2][30] = { + { + 9305, 9306, 9307, 9308 + }, + { + 9307, 9306, 9305, 9309 + } + }; + + // Loop through all frames to remove overlay and replace use of 3240 with that from tilearray and disable overlays. + for (i = 0; i < pQAV->nFrames; i++) + { + pQAV->frames[i].tiles[0].picnum = tilearray[0][i]; + pQAV->frames[i].tiles[4].picnum = -1; + + pQAV->frames[i].tiles[2].picnum = tilearray[1][i]; + pQAV->frames[i].tiles[5].picnum = -1; + } + break; + } default: return; }