From 029aea0fc252995c521abe5bb2b35fa841929d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 6 Jul 2017 22:20:07 +0200 Subject: [PATCH] Remove reset_empty_sprites Leave in sprite_clear_all_unused as the safer version --- src/openrct2/rct2/S6Exporter.cpp | 4 +--- src/openrct2/world/sprite.c | 16 ---------------- src/openrct2/world/sprite.h | 1 - 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 6e2951c61b..45c8dda18d 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -184,9 +184,7 @@ void S6Exporter::Export() // Might as well reset them in here to zero out the space and improve // compression ratios. Especially useful for multiplayer servers that // use zlib on the sent stream. - { - reset_empty_sprites(); - } + sprite_clear_all_unused(); for (sint32 i = 0; i < MAX_SPRITES; i++) { memcpy(&_s6.sprites[i], get_sprite(i), sizeof(rct_sprite)); diff --git a/src/openrct2/world/sprite.c b/src/openrct2/world/sprite.c index 107dab6c5e..f153d3ef6d 100644 --- a/src/openrct2/world/sprite.c +++ b/src/openrct2/world/sprite.c @@ -296,22 +296,6 @@ void sprite_clear_all_unused() } } -// Resets all sprites in SPRITE_LIST_NULL list -void reset_empty_sprites() -{ - uint16 spriteIndex; - spriteIndex = gSpriteListHead[SPRITE_LIST_NULL]; - while (spriteIndex != SPRITE_INDEX_NULL) - { - rct_unk_sprite *sprite = &(get_sprite(spriteIndex))->unknown; - spriteIndex = sprite->next; - if (sprite->sprite_identifier == SPRITE_IDENTIFIER_NULL) - { - sprite_reset(sprite); - } - } -} - /* * rct2: 0x0069EC6B * bl: if bl & 2 > 0, the sprite ends up in the MISC linked list. diff --git a/src/openrct2/world/sprite.h b/src/openrct2/world/sprite.h index 1cbe3415d0..5f0f4c7848 100644 --- a/src/openrct2/world/sprite.h +++ b/src/openrct2/world/sprite.h @@ -419,7 +419,6 @@ extern uint16 *gSpriteListCount; extern uint16 gSpriteSpatialIndex[0x10001]; rct_sprite *create_sprite(uint8 bl); -void reset_empty_sprites(); void reset_sprite_list(); void reset_sprite_spatial_index(); void sprite_clear_all_unused();