1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

Zero g1 elements when freeing images

This is to help diagnose issues where we are drawing invalid sprites as well as general cleanliness
This commit is contained in:
Ted John
2016-07-16 18:07:48 +01:00
parent 83fa818190
commit 964cf66f6b

View File

@@ -145,6 +145,15 @@ extern "C"
{
if (baseImageId != 0)
{
// Zero the G1 elements so we don't have invalid pointers
// and data lying about
for (uint32 i = 0; i < count; i++)
{
uint32 imageId = baseImageId + i;
g1Elements[imageId] = { 0 };
drawing_engine_invalidate_image(imageId);
}
FreeImageList(baseImageId, count);
}
}