1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 00:04:43 +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

@@ -17,6 +17,7 @@
#pragma warning(disable : 4706) // assignment within conditional expression
#include <unordered_map>
#include "../Context.h"
#include "../core/IStream.hpp"
#include "../core/Memory.hpp"
#include "../core/String.hpp"
@@ -28,6 +29,8 @@
#include "ObjectRepository.h"
#include "SceneryGroupObject.h"
using namespace OpenRCT2;
void SceneryGroupObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
{
stream->Seek(6, STREAM_SEEK_CURRENT);
@@ -71,8 +74,9 @@ void SceneryGroupObject::DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint
void SceneryGroupObject::UpdateEntryIndexes()
{
IObjectRepository * objectRepository = GetObjectRepository();
IObjectManager * objectManager = GetObjectManager();
auto context = GetContext();
IObjectRepository * objectRepository = context->GetObjectRepository();
IObjectManager * objectManager = context->GetObjectManager();
_legacyType.entry_count = 0;
for (const auto &objectEntry : _items)