From 10395688bf950dc5ae2ef948a55b9849de065f73 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 30 Apr 2021 20:04:43 +0200 Subject: [PATCH] - must restore the laptop background of Exhumed's LEV20 cutscene each frame. Also fixed the variable names in this function. --- source/games/exhumed/src/2d.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/source/games/exhumed/src/2d.cpp b/source/games/exhumed/src/2d.cpp index 4131f1e1d..56966552a 100644 --- a/source/games/exhumed/src/2d.cpp +++ b/source/games/exhumed/src/2d.cpp @@ -497,33 +497,30 @@ void uploadCinemaPalettes() static int DoStatic(int a, int b) { + TileFiles.tileMakeWritable(kTileLoboLaptop); + auto tex = dynamic_cast(tileGetTexture(kTileLoboLaptop)->GetTexture()->GetImage()); + if (tex) tex->Reload(); auto pixels = TileFiles.tileMakeWritable(kTileLoboLaptop); - int v2 = 160 - a / 2; - int v4 = 81 - b / 2; + int y = 160 - a / 2; + int left = 81 - b / 2; - int var_18 = v2 + a; - int v5 = v4 + b; + int bottom = y + a; + int right = left + b; - auto pTile = (pixels + (200 * v2)) + v4; + auto pTile = (pixels + (200 * y)) + left; TileFiles.InvalidateTile(kTileLoboLaptop); - while (v2 < var_18) + for(;y < bottom; y++) { - uint8_t* pStart = pTile; + uint8_t* pixel = pTile; pTile += 200; - int v7 = v4; - - while (v7 < v5) + for (int x = left; x < right; x++) { - *pStart = RandomBit() * 16; - - v7++; - pStart++; + *pixel++ = RandomBit() * 16; } - v2++; } return tileGetTexture(kTileLoboLaptop)->GetID().GetIndex(); }