diff --git a/src/editor.c b/src/editor.c index 28adee5d2d..3262ca8a6d 100644 --- a/src/editor.c +++ b/src/editor.c @@ -26,6 +26,7 @@ #include "management/finance.h" #include "management/news_item.h" #include "object.h" +#include "object/ObjectManager.h" #include "peep/staff.h" #include "platform/platform.h" #include "rct1.h" @@ -59,7 +60,7 @@ void editor_load() audio_pause_sounds(); audio_unpause_sounds(); - object_unload_all(); + object_manager_unload_all_objects(); object_list_load(); map_init(150); banner_init(); @@ -146,7 +147,7 @@ void trackdesigner_load() gScreenFlags = SCREEN_FLAGS_TRACK_DESIGNER; gScreenAge = 0; - object_unload_all(); + object_manager_unload_all_objects(); object_list_load(); map_init(150); set_all_land_owned(); @@ -185,7 +186,7 @@ void trackmanager_load() gScreenFlags = SCREEN_FLAGS_TRACK_MANAGER; gScreenAge = 0; - object_unload_all(); + object_manager_unload_all_objects(); object_list_load(); map_init(150); set_all_land_owned(); @@ -484,7 +485,7 @@ void editor_open_windows_for_current_step() return; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { - object_unload_all(); + object_manager_unload_all_objects(); } window_editor_object_selection_open(); diff --git a/src/object.h b/src/object.h index c0ec05d5ed..201b8ab2c4 100644 --- a/src/object.h +++ b/src/object.h @@ -112,7 +112,6 @@ bool object_read_and_load_entries(SDL_RWops* rw); bool object_load_entries(rct_object_entry* entries); int object_load_packed(SDL_RWops* rw); bool object_saved_packed(SDL_RWops* rw, const rct_object_entry * entry); -void object_unload_all(); int check_object_entry(const rct_object_entry *entry); bool object_entry_compare(const rct_object_entry *a, const rct_object_entry *b); diff --git a/src/rct1/S4Importer.cpp b/src/rct1/S4Importer.cpp index b4110a24bc..fcdd6343d4 100644 --- a/src/rct1/S4Importer.cpp +++ b/src/rct1/S4Importer.cpp @@ -37,6 +37,7 @@ extern "C" #include "../management/finance.h" #include "../management/marketing.h" #include "../object.h" + #include "../object/ObjectManager.h" #include "../peep/staff.h" #include "../rct1.h" #include "../util/sawyercoding.h" @@ -111,7 +112,7 @@ void S4Importer::Initialise() // Do map initialisation, same kind of stuff done when loading scenario editor audio_pause_sounds(); audio_unpause_sounds(); - object_unload_all(); + GetObjectManager()->UnloadAll(); map_init(mapSize); banner_init(); reset_park_entrances(); diff --git a/src/rct2.c b/src/rct2.c index b081a7db5b..98d4e536c0 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -35,6 +35,7 @@ #include "network/network.h" #include "network/twitch.h" #include "object.h" +#include "object/ObjectManager.h" #include "openrct2.h" #include "peep/staff.h" #include "platform/platform.h" @@ -140,7 +141,7 @@ void rct2_dispose() { gfx_unload_g2(); gfx_unload_g1(); - object_unload_all(); + object_manager_unload_all_objects(); } int rct2_init()