mirror of https://github.com/AxioDL/metaforce.git
CParticleGenInfo: Collapse TCastToPtr into conditions
Same behavior, but more compact.
This commit is contained in:
parent
39e8ee9a80
commit
852dd5c6bf
|
@ -55,9 +55,11 @@ void CParticleGenInfoGeneric::Render() { x84_system->Render(); }
|
||||||
void CParticleGenInfoGeneric::Update(float dt, CStateManager& stateMgr) {
|
void CParticleGenInfoGeneric::Update(float dt, CStateManager& stateMgr) {
|
||||||
x84_system->Update(dt);
|
x84_system->Update(dt);
|
||||||
|
|
||||||
if (x88_lightId != kInvalidUniqueId) {
|
if (x88_lightId == kInvalidUniqueId) {
|
||||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
return;
|
||||||
if (gl)
|
}
|
||||||
|
|
||||||
|
if (const TCastToPtr<CGameLight> gl = stateMgr.ObjectById(x88_lightId)) {
|
||||||
gl->SetLight(x84_system->GetLight());
|
gl->SetLight(x84_system->GetLight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,9 +67,11 @@ void CParticleGenInfoGeneric::Update(float dt, CStateManager& stateMgr) {
|
||||||
void CParticleGenInfoGeneric::SetOrientation(const zeus::CTransform& xf, CStateManager& stateMgr) {
|
void CParticleGenInfoGeneric::SetOrientation(const zeus::CTransform& xf, CStateManager& stateMgr) {
|
||||||
x84_system->SetOrientation(xf);
|
x84_system->SetOrientation(xf);
|
||||||
|
|
||||||
if (x88_lightId != kInvalidUniqueId) {
|
if (x88_lightId == kInvalidUniqueId) {
|
||||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
return;
|
||||||
if (gl)
|
}
|
||||||
|
|
||||||
|
if (const TCastToPtr<CGameLight> gl = stateMgr.ObjectById(x88_lightId)) {
|
||||||
gl->SetRotation(zeus::CQuaternion(xf.buildMatrix3f()));
|
gl->SetRotation(zeus::CQuaternion(xf.buildMatrix3f()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,9 +79,11 @@ void CParticleGenInfoGeneric::SetOrientation(const zeus::CTransform& xf, CStateM
|
||||||
void CParticleGenInfoGeneric::SetTranslation(const zeus::CVector3f& trans, CStateManager& stateMgr) {
|
void CParticleGenInfoGeneric::SetTranslation(const zeus::CVector3f& trans, CStateManager& stateMgr) {
|
||||||
x84_system->SetTranslation(trans);
|
x84_system->SetTranslation(trans);
|
||||||
|
|
||||||
if (x88_lightId != kInvalidUniqueId) {
|
if (x88_lightId == kInvalidUniqueId) {
|
||||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
return;
|
||||||
if (gl)
|
}
|
||||||
|
|
||||||
|
if (const TCastToPtr<CGameLight> gl = stateMgr.ObjectById(x88_lightId)) {
|
||||||
gl->SetTranslation(trans);
|
gl->SetTranslation(trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,9 +91,11 @@ void CParticleGenInfoGeneric::SetTranslation(const zeus::CVector3f& trans, CStat
|
||||||
void CParticleGenInfoGeneric::SetGlobalOrientation(const zeus::CTransform& xf, CStateManager& stateMgr) {
|
void CParticleGenInfoGeneric::SetGlobalOrientation(const zeus::CTransform& xf, CStateManager& stateMgr) {
|
||||||
x84_system->SetGlobalOrientation(xf);
|
x84_system->SetGlobalOrientation(xf);
|
||||||
|
|
||||||
if (x88_lightId != kInvalidUniqueId) {
|
if (x88_lightId == kInvalidUniqueId) {
|
||||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
return;
|
||||||
if (gl)
|
}
|
||||||
|
|
||||||
|
if (const TCastToPtr<CGameLight> gl = stateMgr.ObjectById(x88_lightId)) {
|
||||||
gl->SetRotation(zeus::CQuaternion(xf.buildMatrix3f()));
|
gl->SetRotation(zeus::CQuaternion(xf.buildMatrix3f()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,9 +103,11 @@ void CParticleGenInfoGeneric::SetGlobalOrientation(const zeus::CTransform& xf, C
|
||||||
void CParticleGenInfoGeneric::SetGlobalTranslation(const zeus::CVector3f& trans, CStateManager& stateMgr) {
|
void CParticleGenInfoGeneric::SetGlobalTranslation(const zeus::CVector3f& trans, CStateManager& stateMgr) {
|
||||||
x84_system->SetGlobalTranslation(trans);
|
x84_system->SetGlobalTranslation(trans);
|
||||||
|
|
||||||
if (x88_lightId != kInvalidUniqueId) {
|
if (x88_lightId == kInvalidUniqueId) {
|
||||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
return;
|
||||||
if (gl)
|
}
|
||||||
|
|
||||||
|
if (const TCastToPtr<CGameLight> gl = stateMgr.ObjectById(x88_lightId)) {
|
||||||
gl->SetTranslation(trans);
|
gl->SetTranslation(trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,9 +117,7 @@ void CParticleGenInfoGeneric::SetGlobalScale(const zeus::CVector3f& scale) { x84
|
||||||
void CParticleGenInfoGeneric::SetParticleEmission(bool isActive, CStateManager& stateMgr) {
|
void CParticleGenInfoGeneric::SetParticleEmission(bool isActive, CStateManager& stateMgr) {
|
||||||
x84_system->SetParticleEmission(isActive);
|
x84_system->SetParticleEmission(isActive);
|
||||||
|
|
||||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
if (const TCastToPtr<CGameLight> gl = stateMgr.ObjectById(x88_lightId)) {
|
||||||
|
|
||||||
if (gl) {
|
|
||||||
gl->SetActive(isActive);
|
gl->SetActive(isActive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue