From 91b5b3ed73b9127ad704e13198135e44e4240131 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 13 Aug 2016 17:05:50 -1000 Subject: [PATCH] Set up CStateManagerContainer pointers --- Runtime/CStateManager.cpp | 10 +++++++++- Runtime/CStateManager.hpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index be7c1141c..71daf987c 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -35,7 +35,15 @@ CStateManager::CStateManager(const std::weak_ptr&, x83c_aiWaypointObjs(new CAiWaypointList()), x844_platformAndDoorObjs(new CPlatformAndDoorList()) { - x86c_stateManagerContainer.emplace(); + x86c_stateManagerContainer.reset(new CStateManagerContainer); + x870_cameraManager = &x86c_stateManagerContainer->x0_cameraManager; + x874_sortedListManager = &x86c_stateManagerContainer->x3c0_sortedListManager; + x878_weaponManager = &x86c_stateManagerContainer->xe3d8_weaponManager; + x87c_fluidPlaneManager = &x86c_stateManagerContainer->xe3ec_fluidPlaneManager; + x880_envFxManager = &x86c_stateManagerContainer->xe510_envFxManager; + x884_actorModelParticles = &x86c_stateManagerContainer->xf168_actorModelParticles; + x88c_rumbleManager = &x86c_stateManagerContainer->xf250_rumbleManager; + x904_loaderFuncs[int(EScriptObjectType::Actor)] = ScriptLoader::LoadActor; x904_loaderFuncs[int(EScriptObjectType::Waypoint)] = ScriptLoader::LoadWaypoint; x904_loaderFuncs[int(EScriptObjectType::Door)] = ScriptLoader::LoadDoor; diff --git a/Runtime/CStateManager.hpp b/Runtime/CStateManager.hpp index 4b6c1b21c..d7d3f6fe0 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/CStateManager.hpp @@ -83,7 +83,7 @@ class CStateManager u32 xf370_ = 0; u32 xf39c_ = 0; }; - std::experimental::optional x86c_stateManagerContainer; + std::unique_ptr x86c_stateManagerContainer; CCameraManager* x870_cameraManager = nullptr; CSortedListManager* x874_sortedListManager = nullptr; CWeaponMgr* x878_weaponManager = nullptr;