1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Give context the ownership of repositories and the object manager (#7340)

This makes them no longer a singleton, which fixes annoying behaviour when launching multiple contexts in one game session.
This commit is contained in:
Hielke Morsink
2018-04-10 14:19:23 +02:00
committed by Ted John
parent 8fbe6e63d8
commit dc673a64d8
22 changed files with 117 additions and 99 deletions

View File

@@ -16,6 +16,7 @@
#include <cstring>
#include "../Context.h"
#include "../core/Math.hpp"
#include "../core/Util.hpp"
#include "../Game.h"
@@ -167,7 +168,7 @@ void * object_entry_get_chunk(sint32 objectType, size_t index)
}
void * result = nullptr;
auto objectMgr = GetObjectManager();
auto objectMgr = OpenRCT2::GetContext()->GetObjectManager();
auto obj = objectMgr->GetLoadedObject(objectIndex);
if (obj != nullptr)
{
@@ -179,7 +180,7 @@ void * object_entry_get_chunk(sint32 objectType, size_t index)
const rct_object_entry * object_entry_get_entry(sint32 objectType, size_t index)
{
const rct_object_entry * result = nullptr;
auto objectMgr = GetObjectManager();
auto objectMgr = OpenRCT2::GetContext()->GetObjectManager();
auto obj = objectMgr->GetLoadedObject(objectType, index);
if (obj != nullptr)
{