Fix IGetAreaId and rename GetAreaId to GetAreaIndex

This commit is contained in:
Phillip Stephens 2020-10-20 03:03:11 -07:00
parent 3ffa15cfa3
commit a8d8eb0dde
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
7 changed files with 18 additions and 18 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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<std::unique_ptr<u8[]>, 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;
}

View File

@ -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<u16> x44_attachedAreaIndices;
std::vector<Dock> x54_docks;
@ -56,7 +56,7 @@ public:
CDummyGameArea(CInputStream& in, int idx, int mlvlVersion);
std::pair<std::unique_ptr<u8[]>, 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<std::unique_ptr<u8[]>, 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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -49,7 +49,7 @@ public:
};
virtual std::pair<std::unique_ptr<u8[]>, 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;