- must restore the laptop background of Exhumed's LEV20 cutscene each frame.

Also fixed the variable names in this function.
This commit is contained in:
Christoph Oelckers 2021-04-30 20:04:43 +02:00
parent 4069a5096a
commit 10395688bf

View file

@ -497,33 +497,30 @@ void uploadCinemaPalettes()
static int DoStatic(int a, int b) static int DoStatic(int a, int b)
{ {
TileFiles.tileMakeWritable(kTileLoboLaptop);
auto tex = dynamic_cast<FRestorableTile*>(tileGetTexture(kTileLoboLaptop)->GetTexture()->GetImage());
if (tex) tex->Reload();
auto pixels = TileFiles.tileMakeWritable(kTileLoboLaptop); auto pixels = TileFiles.tileMakeWritable(kTileLoboLaptop);
int v2 = 160 - a / 2; int y = 160 - a / 2;
int v4 = 81 - b / 2; int left = 81 - b / 2;
int var_18 = v2 + a; int bottom = y + a;
int v5 = v4 + b; int right = left + b;
auto pTile = (pixels + (200 * v2)) + v4; auto pTile = (pixels + (200 * y)) + left;
TileFiles.InvalidateTile(kTileLoboLaptop); TileFiles.InvalidateTile(kTileLoboLaptop);
while (v2 < var_18) for(;y < bottom; y++)
{ {
uint8_t* pStart = pTile; uint8_t* pixel = pTile;
pTile += 200; pTile += 200;
int v7 = v4; for (int x = left; x < right; x++)
while (v7 < v5)
{ {
*pStart = RandomBit() * 16; *pixel++ = RandomBit() * 16;
v7++;
pStart++;
} }
v2++;
} }
return tileGetTexture(kTileLoboLaptop)->GetID().GetIndex(); return tileGetTexture(kTileLoboLaptop)->GetID().GetIndex();
} }