From 60098aeef07de1c7283349c58bf60fbc3f6ff420 Mon Sep 17 00:00:00 2001 From: Ted John Date: Thu, 7 Jul 2016 22:18:34 +0100 Subject: [PATCH] remove last use of object_load_chunk --- src/object.h | 1 - src/object/ObjectRepository.cpp | 52 --------------------------------- src/windows/install_track.c | 5 ++-- 3 files changed, 3 insertions(+), 55 deletions(-) diff --git a/src/object.h b/src/object.h index d5a2dea50a..c0ec05d5ed 100644 --- a/src/object.h +++ b/src/object.h @@ -115,7 +115,6 @@ 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_load_chunk(int groupIndex, const rct_object_entry * entry, int * outGroupIndex); bool object_entry_compare(const rct_object_entry *a, const rct_object_entry *b); int object_calculate_checksum(const rct_object_entry * entry, const void * data, size_t dataLength); void reset_loaded_objects(); diff --git a/src/object/ObjectRepository.cpp b/src/object/ObjectRepository.cpp index 958121f7f9..67b3656dcc 100644 --- a/src/object/ObjectRepository.cpp +++ b/src/object/ObjectRepository.cpp @@ -622,58 +622,6 @@ extern "C" objectRepository->LoadOrConstruct(); } - bool object_load_chunk(int groupIndex, const rct_object_entry * entry, int * outGroupIndex) - { - return false; - - // IObjectRepository * objectRepository = GetObjectRepository(); - // const ObjectRepositoryItem * ori = objectRepository->FindObject(entry); - // if (ori == nullptr) - // { - // ReportMissingObject(entry); - // return false; - // } - // - // Object * object = objectRepository->LoadObject(ori); - // if (object == nullptr) - // { - // utf8 objName[9] = { 0 }; - // Memory::Copy(objName, ori->ObjectEntry.name, 8); - // Console::Error::WriteFormat("[%s]: Object could not be loaded.", objName); - // Console::Error::WriteLine(); - // return false; - // } - // - // uint8 objectType = object->GetObjectType(); - // void * * chunkList = object_entry_groups[objectType].chunks; - // if (groupIndex == -1) - // { - // for (groupIndex = 0; chunkList[groupIndex] != (void*)-1; groupIndex++) - // { - // if (groupIndex + 1 >= object_entry_group_counts[objectType]) - // { - // log_error("Object Load failed due to too many objects of a certain type."); - // delete object; - // return false; - // } - // } - // } - // chunkList[groupIndex] = object->GetLegacyData(); - // if (outGroupIndex != nullptr) - // { - // *outGroupIndex = groupIndex; - // } - // - // rct_object_entry_extended * extendedEntry = &object_entry_groups[objectType].entries[groupIndex]; - // Memory::Copy(extendedEntry, object->GetObjectEntry(), sizeof(rct_object_entry)); - // extendedEntry->chunk_size = 0; - // - // int loadedObjectIndex = GetObjectEntryIndex(objectType, groupIndex); - // delete _loadedObjects[loadedObjectIndex]; - // _loadedObjects[loadedObjectIndex] = object; - // return true; - } - bool object_load_entries(rct_object_entry * entries) { log_verbose("loading required objects"); diff --git a/src/windows/install_track.c b/src/windows/install_track.c index f24e16f298..8d5da61a57 100644 --- a/src/windows/install_track.c +++ b/src/windows/install_track.c @@ -24,6 +24,7 @@ #include "../ride/ride.h" #include "../ride/track.h" #include "../ride/track_design.h" +#include "../object/ObjectManager.h" #include "../sprites.h" #include "../util/util.h" #include "error.h" @@ -108,12 +109,12 @@ void window_install_track_open(const utf8 *path) return; } - object_unload_all(); + object_manager_unload_all_objects(); if (_trackDesign->type == RIDE_TYPE_NULL){ log_error("Failed to load track (ride type null): %s", path); return; } - if (!object_load_chunk(0, &_trackDesign->vehicle_object, NULL)){ + if (object_manager_load_object(&_trackDesign->vehicle_object) == NULL) { log_error("Failed to load track (vehicle load fail): %s", path); return; }