From 037fcfd446e7b87d1d3b8f1438795311cec25b6c Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 12 Aug 2021 12:54:26 +1000 Subject: [PATCH] - Blood: Add interpolation repair for `kQAVBUNDOWN` (res_id: 17). --- source/games/blood/src/qav.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/games/blood/src/qav.cpp b/source/games/blood/src/qav.cpp index 0176ee567..1168a400e 100644 --- a/source/games/blood/src/qav.cpp +++ b/source/games/blood/src/qav.cpp @@ -454,6 +454,17 @@ static void qavRepairTileData(QAV* pQAV) } } break; + case kQAVBUNDOWN: + // BUNDOWN requires some tile index swaps to be cleaned up to avoid using our own callback. + // For frames 3 till the end, backup tile index 3, move indices 1 and 2 down, then restore backed up tile index 3 as 1. + for (i = 3; i < pQAV->nFrames; i++) + { + backup = pQAV->frames[i].tiles[3]; + pQAV->frames[i].tiles[3] = pQAV->frames[i].tiles[2]; + pQAV->frames[i].tiles[2] = pQAV->frames[i].tiles[1]; + pQAV->frames[i].tiles[1] = backup; + } + break; default: return; }