2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 21:11:21 +00:00
metaforce/Runtime/World/CScriptAreaAttributes.cpp
Lioncash 221cc5c6b8 RuntimeCommonB: Normalize cpp file includes
Like the prior changes normalizing the inclusions within headers, this
tackles the cpp files of the RuntimeCommonB target, making these source
files consistent with their headers.
2019-12-22 18:12:04 -05:00

46 lines
1.6 KiB
C++

#include "Runtime/World/CScriptAreaAttributes.hpp"
#include "Runtime/CStateManager.hpp"
#include "Runtime/World/CEnvFxManager.hpp"
#include "Runtime/World/CWorld.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
namespace urde {
CScriptAreaAttributes::CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& info, bool showSkybox, EEnvFxType fxType,
float envFxDensity, float thermalHeat, float xrayFogDistance,
float worldLightingLevel, CAssetId skybox, EPhazonType phazonType)
: CEntity(uid, info, true, std::string())
, x34_24_showSkybox(showSkybox)
, x38_envFx(fxType)
, x3c_envFxDensity(envFxDensity)
, x40_thermalHeat(thermalHeat)
, x44_xrayFogDistance(xrayFogDistance)
, x48_worldLightingLevel(worldLightingLevel)
, x4c_skybox(skybox)
, x50_phazon(phazonType) {}
void CScriptAreaAttributes::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptAreaAttributes::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) {
CEntity::AcceptScriptMsg(msg, objId, stateMgr);
if (x4_areaId == kInvalidAreaId)
return;
if (msg == EScriptObjectMessage::InitializedInArea) {
CGameArea* area = stateMgr.GetWorld()->GetArea(x4_areaId);
area->SetAreaAttributes(this);
stateMgr.GetEnvFxManager()->SetFxDensity(500, x3c_envFxDensity);
} else if (msg == EScriptObjectMessage::Deleted) {
CGameArea* area = stateMgr.GetWorld()->GetArea(x4_areaId);
if (!area->IsPostConstructed())
return;
area->SetAreaAttributes(nullptr);
}
}
} // namespace urde