From dfa3a52fa82740e730e76e1c42a7069871148986 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 12 Aug 2021 13:18:53 +1000 Subject: [PATCH] - Blood: Add interpolation repair for `kQAVFLARUP` (res_id: 41). --- source/games/blood/src/qav.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/games/blood/src/qav.cpp b/source/games/blood/src/qav.cpp index d46fb820d..5e9570056 100644 --- a/source/games/blood/src/qav.cpp +++ b/source/games/blood/src/qav.cpp @@ -739,6 +739,16 @@ static void qavRepairTileData(QAV* pQAV) } break; + case kQAVFLARUP: + // FLARUP interpolates fine, but the final frame in bringing the flaregun up is lower than the flaregun while idle. + // Do linear interpolation from 2nd frame through to last frame, ending with coordinates of FLARIDLE. + lastframe = pQAV->nFrames - 1; + for (i = 1; i < pQAV->nFrames; i++) + { + pQAV->frames[i].tiles[0].x = xs_CRoundToInt(pQAV->frames[0].tiles[0].x - (double(pQAV->frames[0].tiles[0].x - 57) / lastframe) * i); + pQAV->frames[i].tiles[0].y = xs_CRoundToInt(pQAV->frames[0].tiles[0].y - (double(pQAV->frames[0].tiles[0].y - -30) / lastframe) * i); + } + break; default: return; }