mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 17:47:42 +00:00
New code style refactor
This commit is contained in:
@@ -3,57 +3,52 @@
|
||||
#include "CStateManager.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
|
||||
CGameLight::CGameLight(TUniqueId uid, TAreaId aid, bool active, std::string_view name, const zeus::CTransform& xf,
|
||||
TUniqueId parentId, const CLight& light, u32 sourceId, u32 w2, float f1)
|
||||
: CActor(uid, active, name, CEntityInfo(aid, CEntity::NullConnectionList), xf,
|
||||
CModelData::CModelDataNull(), CMaterialList(), CActorParameters::None(), kInvalidUniqueId),
|
||||
xe8_parentId(parentId), xec_light(light), x13c_lightId(sourceId), x140_priority(w2), x144_lifeTime(f1)
|
||||
{
|
||||
xec_light.GetRadius();
|
||||
xec_light.GetIntensity();
|
||||
SetLightPriorityAndId();
|
||||
: CActor(uid, active, name, CEntityInfo(aid, CEntity::NullConnectionList), xf, CModelData::CModelDataNull(),
|
||||
CMaterialList(), CActorParameters::None(), kInvalidUniqueId)
|
||||
, xe8_parentId(parentId)
|
||||
, xec_light(light)
|
||||
, x13c_lightId(sourceId)
|
||||
, x140_priority(w2)
|
||||
, x144_lifeTime(f1) {
|
||||
xec_light.GetRadius();
|
||||
xec_light.GetIntensity();
|
||||
SetLightPriorityAndId();
|
||||
}
|
||||
|
||||
void CGameLight::Accept(IVisitor &visitor)
|
||||
{
|
||||
visitor.Visit(this);
|
||||
void CGameLight::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
||||
|
||||
void CGameLight::Think(float dt, CStateManager& mgr) {
|
||||
if (x144_lifeTime <= 0.f)
|
||||
return;
|
||||
x144_lifeTime -= dt;
|
||||
|
||||
if (x144_lifeTime <= 0.f)
|
||||
mgr.FreeScriptObject(GetUniqueId());
|
||||
}
|
||||
|
||||
void CGameLight::Think(float dt, CStateManager& mgr)
|
||||
{
|
||||
if (x144_lifeTime <= 0.f)
|
||||
return;
|
||||
x144_lifeTime -= dt;
|
||||
|
||||
if (x144_lifeTime <= 0.f)
|
||||
mgr.FreeScriptObject(GetUniqueId());
|
||||
void CGameLight::SetLightPriorityAndId() {
|
||||
xec_light.x3c_priority = x140_priority;
|
||||
xec_light.x40_lightId = x13c_lightId;
|
||||
}
|
||||
|
||||
void CGameLight::SetLightPriorityAndId()
|
||||
{
|
||||
xec_light.x3c_priority = x140_priority;
|
||||
xec_light.x40_lightId = x13c_lightId;
|
||||
void CGameLight::SetLight(const CLight& light) {
|
||||
xec_light = light;
|
||||
xec_light.GetRadius();
|
||||
xec_light.GetIntensity();
|
||||
SetLightPriorityAndId();
|
||||
}
|
||||
|
||||
void CGameLight::SetLight(const CLight& light)
|
||||
{
|
||||
xec_light = light;
|
||||
xec_light.GetRadius();
|
||||
xec_light.GetIntensity();
|
||||
SetLightPriorityAndId();
|
||||
}
|
||||
CLight CGameLight::GetLight() const {
|
||||
CLight ret = xec_light;
|
||||
ret.SetPosition(x34_transform * xec_light.GetPosition());
|
||||
|
||||
CLight CGameLight::GetLight() const
|
||||
{
|
||||
CLight ret = xec_light;
|
||||
ret.SetPosition(x34_transform * xec_light.GetPosition());
|
||||
if (ret.GetType() != ELightType::Point)
|
||||
ret.SetDirection(x34_transform.rotate(xec_light.GetDirection()).normalized());
|
||||
|
||||
if (ret.GetType() != ELightType::Point)
|
||||
ret.SetDirection(x34_transform.rotate(xec_light.GetDirection()).normalized());
|
||||
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user