Fix visual artifacts caused by null tiles

This commit is contained in:
Alexander Batalov 2022-12-21 09:18:29 +03:00
parent 343911f736
commit c0908cf14f
1 changed files with 12 additions and 0 deletions

View File

@ -1716,6 +1716,18 @@ static int _square_load(File* stream, int flags)
} }
} }
// CE: Replace null tiles with a solid black tiles. This prevents copying
// buffer contents of nearby tiles during scrolling and repeating hex
// pointer when hovering mouse over null tiles.
for (int elevation = 0; elevation < ELEVATION_COUNT; elevation++) {
for (int tileIndex = 0; tileIndex < SQUARE_GRID_SIZE; tileIndex++) {
int tile = _square[elevation]->field_0[tileIndex];
if (tile == 0x00010001) {
_square[elevation]->field_0[tileIndex] = 0x00010293;
}
}
}
return 0; return 0;
} }