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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user