diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index d37afdc8d..24d06449f 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -2004,7 +2004,7 @@ void CStateManager::UpdateAreaSounds() { occState = area.GetOcclusionState(); } if (occState == CGameArea::EOcclusionState::Visible) { - areas.push_back(area.GetAreaId()); + areas.push_back(area.GetAreaIndex()); } } CSfxManager::SetActiveAreas(areas); diff --git a/Runtime/Character/CActorLights.cpp b/Runtime/Character/CActorLights.cpp index 70530aebf..3365ae2f1 100644 --- a/Runtime/Character/CActorLights.cpp +++ b/Runtime/Character/CActorLights.cpp @@ -183,7 +183,7 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea& } zeus::CVector3f vec; - if (!x298_24_dirty && x294_aid == area.GetAreaId()) { + if (!x298_24_dirty && x294_aid == area.GetAreaIndex()) { /* Early return if not ready for update */ if (mgr.GetInputFrameIdx() - x2a4_lastUpdateFrame < x2a8_areaUpdateFramePeriod) return false; @@ -193,7 +193,7 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea& return false; x2c0_lastActorPos = vec; } else { - if (x294_aid != area.GetAreaId()) + if (x294_aid != area.GetAreaIndex()) x2d8_brightLightIdx = -1; x2a4_lastUpdateFrame = sFrameSchedulerCount + mgr.GetInputFrameIdx(); vec = aabb.center() + x2ac_actorPosBias; @@ -203,7 +203,7 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea& /* Reset lighting state */ x2d4_worldLightingLevel = worldLightingLevel; x298_24_dirty = false; - x294_aid = area.GetAreaId(); + x294_aid = area.GetAreaIndex(); x29c_shadowLightArrIdx = -1; x288_ambientColor = zeus::skClear; diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index 786c254cc..696ed5b22 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -306,7 +306,7 @@ CDummyGameArea::CDummyGameArea(CInputStream& in, int idx, int mlvlVersion) { aabb.readBoundingBoxBig(in); xc_mrea = in.readUint32Big(); if (mlvlVersion > 15) - x10_areaId = in.readUint32Big(); + x10_areaId = CAssetId(in); u32 attachAreaCount = in.readUint32Big(); x44_attachedAreaIndices.reserve(attachAreaCount); @@ -332,7 +332,7 @@ std::pair, s32> CDummyGameArea::IGetScriptingMemoryAlways( return GetScriptingMemoryAlways(*this); } -TAreaId CDummyGameArea::IGetAreaId() const { return x10_areaId; } +CAssetId CDummyGameArea::IGetAreaId() const { return x10_areaId; } CAssetId CDummyGameArea::IGetAreaAssetId() const { return xc_mrea; } @@ -354,9 +354,9 @@ CGameArea::CGameArea(CInputStream& in, int idx, int mlvlVersion) : x4_selfIdx(id x84_mrea = in.readUint32Big(); if (mlvlVersion > 15) - x88_areaId = in.readInt32Big(); + x88_areaId = CAssetId(in); else - x88_areaId = -1; + x88_areaId = CAssetId(); const u32 attachedCount = in.readUint32Big(); x8c_attachedAreaIndices.reserve(attachedCount); @@ -782,7 +782,7 @@ bool CGameArea::Invalidate(CStateManager* mgr) { } if (mgr) - mgr->PrepareAreaUnload(GetAreaId()); + mgr->PrepareAreaUnload(GetAreaIndex()); #if 0 dword_805a8eb0 -= GetPostConstructedSize(); @@ -797,7 +797,7 @@ bool CGameArea::Invalidate(CStateManager* mgr) { KillmAreaData(); ClearTokenList(); if (mgr) - mgr->AreaUnloaded(GetAreaId()); + mgr->AreaUnloaded(GetAreaIndex()); return true; } diff --git a/Runtime/World/CGameArea.hpp b/Runtime/World/CGameArea.hpp index 4d9f7c1ca..e6e2c1a43 100644 --- a/Runtime/World/CGameArea.hpp +++ b/Runtime/World/CGameArea.hpp @@ -47,7 +47,7 @@ class CDummyGameArea final : public IGameArea { int x4_mlvlVersion; CAssetId x8_nameSTRG; CAssetId xc_mrea; - TAreaId x10_areaId; + CAssetId x10_areaId; zeus::CTransform x14_transform; std::vector x44_attachedAreaIndices; std::vector x54_docks; @@ -56,7 +56,7 @@ public: CDummyGameArea(CInputStream& in, int idx, int mlvlVersion); std::pair, s32> IGetScriptingMemoryAlways() const override; - TAreaId IGetAreaId() const override; + CAssetId IGetAreaId() const override; CAssetId IGetAreaAssetId() const override; bool IIsActive() const override; TAreaId IGetAttachedAreaId(int) const override; @@ -278,8 +278,8 @@ public: void SetLoadPauseState(bool paused); std::pair, s32> IGetScriptingMemoryAlways() const override; - TAreaId GetAreaId() const { return x4_selfIdx; } - TAreaId IGetAreaId() const override { return x4_selfIdx; } + CAssetId GetAreaIndex() const { return x4_selfIdx; } + CAssetId IGetAreaId() const override { return x88_areaId; } CAssetId IGetAreaAssetId() const override { return x84_mrea; } bool IIsActive() const override; TAreaId IGetAttachedAreaId(int) const override; diff --git a/Runtime/World/CMorphBallShadow.cpp b/Runtime/World/CMorphBallShadow.cpp index 0d60b55e0..e9c3886e4 100644 --- a/Runtime/World/CMorphBallShadow.cpp +++ b/Runtime/World/CMorphBallShadow.cpp @@ -16,7 +16,7 @@ void CMorphBallShadow::GatherAreas(const CStateManager& mgr) { if (area.IsPostConstructed()) occState = area.GetPostConstructed()->x10dc_occlusionState; if (occState == CGameArea::EOcclusionState::Visible) - x18_areas.push_back(area.GetAreaId()); + x18_areas.push_back(area.GetAreaIndex()); } } @@ -105,7 +105,7 @@ bool CMorphBallShadow::AreasValid(const CStateManager& mgr) const { continue; if (it == x18_areas.end()) return false; - if (*it != area.GetAreaId()) + if (*it != area.GetAreaIndex()) return false; ++it; } diff --git a/Runtime/World/CScriptDoor.cpp b/Runtime/World/CScriptDoor.cpp index 78384e62b..a0ec4b435 100644 --- a/Runtime/World/CScriptDoor.cpp +++ b/Runtime/World/CScriptDoor.cpp @@ -364,7 +364,7 @@ CScriptDoor::EDoorOpenCondition CScriptDoor::GetDoorOpenCondition(CStateManager& } for (const CGameArea& aliveArea : *world) { - if (aliveArea.GetAreaId() == area->GetAreaId()) { + if (aliveArea.GetAreaIndex() == area->GetAreaIndex()) { continue; } diff --git a/Runtime/World/IGameArea.hpp b/Runtime/World/IGameArea.hpp index 9eb2c870b..9dd8a7579 100644 --- a/Runtime/World/IGameArea.hpp +++ b/Runtime/World/IGameArea.hpp @@ -49,7 +49,7 @@ public: }; virtual std::pair, s32> IGetScriptingMemoryAlways() const = 0; - virtual TAreaId IGetAreaId() const = 0; + virtual CAssetId IGetAreaId() const = 0; virtual CAssetId IGetAreaAssetId() const = 0; virtual bool IIsActive() const = 0; virtual TAreaId IGetAttachedAreaId(int) const = 0;