mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 00:27:42 +00:00
New code style refactor
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
#include "CWorld.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
|
||||
CScriptAreaAttributes::CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& info, bool showSkybox, EEnvFxType fxType,
|
||||
float envFxDensity, float thermalHeat, float xrayFogDistance,
|
||||
@@ -18,36 +17,27 @@ CScriptAreaAttributes::CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& i
|
||||
, x44_xrayFogDistance(xrayFogDistance)
|
||||
, x48_worldLightingLevel(worldLightingLevel)
|
||||
, x4c_skybox(skybox)
|
||||
, x50_phazon(phazonType)
|
||||
{
|
||||
, 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.WorldNC()->GetArea(x4_areaId);
|
||||
area->SetAreaAttributes(this);
|
||||
stateMgr.GetEnvFxManager()->SetFxDensity(500, x3c_envFxDensity);
|
||||
} else if (msg == EScriptObjectMessage::Deleted) {
|
||||
CGameArea* area = stateMgr.WorldNC()->GetArea(x4_areaId);
|
||||
|
||||
if (!area->IsPostConstructed())
|
||||
return;
|
||||
|
||||
area->SetAreaAttributes(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
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.WorldNC()->GetArea(x4_areaId);
|
||||
area->SetAreaAttributes(this);
|
||||
stateMgr.GetEnvFxManager()->SetFxDensity(500, x3c_envFxDensity);
|
||||
}
|
||||
else if (msg == EScriptObjectMessage::Deleted)
|
||||
{
|
||||
CGameArea* area = stateMgr.WorldNC()->GetArea(x4_areaId);
|
||||
|
||||
if (!area->IsPostConstructed())
|
||||
return;
|
||||
|
||||
area->SetAreaAttributes(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user