From c0908cf14fa194a56a3db6fb1801d2053c27746e Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Wed, 21 Dec 2022 09:18:29 +0300 Subject: [PATCH] Fix visual artifacts caused by null tiles --- src/map.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/map.cc b/src/map.cc index 0c3ad1b..79dc317 100644 --- a/src/map.cc +++ b/src/map.cc @@ -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; }