mirror of https://github.com/OpenRCT2/OpenRCT2.git
use object_manager_get_loaded_object instead
This commit is contained in:
parent
c672cb920b
commit
488da7942c
|
@ -711,14 +711,6 @@ extern "C"
|
|||
return (void *)object;
|
||||
}
|
||||
|
||||
void * object_repository_get_loaded_object(uint8 objectType, uint8 entryIndex)
|
||||
{
|
||||
int index = GetObjectEntryIndex(objectType, entryIndex);
|
||||
|
||||
IObjectManager * objectManager = GetObjectManager();
|
||||
return (void *)objectManager->GetLoadedObject(index);
|
||||
}
|
||||
|
||||
void object_repository_unload(size_t itemIndex)
|
||||
{
|
||||
// TODO
|
||||
|
|
|
@ -86,7 +86,6 @@ const ObjectRepositoryItem * object_repository_get_items();
|
|||
const ObjectRepositoryItem * object_repository_find_object_by_entry(const rct_object_entry * entry);
|
||||
const ObjectRepositoryItem * object_repository_find_object_by_name(const char * name);
|
||||
void * object_repository_load_object(const rct_object_entry * objectEntry);
|
||||
void * object_repository_get_loaded_object(uint8 objectType, uint8 entryIndex);
|
||||
void object_repository_unload(size_t itemIndex);
|
||||
|
||||
void object_delete(void * object);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../management/research.h"
|
||||
#include "../object.h"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../object/ObjectRepository.h"
|
||||
#include "../rct1.h"
|
||||
#include "../sprites.h"
|
||||
|
@ -783,9 +784,12 @@ static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo
|
|||
if (chunk == NULL || chunk == (void*)0xFFFFFFFF)
|
||||
return;
|
||||
|
||||
rct_object_entry * entry = &object_entry_groups[objectEntryType].entries[researchItem->entryIndex & 0xFF].entry;
|
||||
|
||||
// Draw preview
|
||||
widget = &w->widgets[WIDX_PREVIEW];
|
||||
void * object = object_repository_get_loaded_object(objectEntryType, researchItem->entryIndex & 0xFF);
|
||||
|
||||
void * object = object_manager_get_loaded_object(entry);
|
||||
if (object != NULL) {
|
||||
rct_drawpixelinfo clipDPI;
|
||||
x = w->x + widget->left + 1;
|
||||
|
|
Loading…
Reference in New Issue