mirror of https://github.com/AxioDL/metaforce.git
Implement CParticleGenInfoGeneric
This commit is contained in:
parent
00247ca53e
commit
362fb6b00d
|
@ -31,6 +31,7 @@ set(DNACOMMON_SOURCES
|
|||
BabeDead.hpp BabeDead.cpp
|
||||
RigInverter.hpp RigInverter.cpp
|
||||
AROTBuilder.hpp AROTBuilder.cpp
|
||||
Tweaks/ITweak.hpp
|
||||
Tweaks/TweakWriter.hpp
|
||||
Tweaks/ITweakGame.hpp
|
||||
Tweaks/ITweakParticle.hpp
|
||||
|
@ -40,7 +41,8 @@ set(DNACOMMON_SOURCES
|
|||
Tweaks/ITweakGunRes.hpp
|
||||
Tweaks/ITweakPlayerRes.hpp
|
||||
Tweaks/ITweakGui.hpp
|
||||
Tweaks/ITweakSlideShow.hpp)
|
||||
Tweaks/ITweakSlideShow.hpp
|
||||
Tweaks/ITweakTargeting.hpp)
|
||||
|
||||
dataspec_add_list(DNACommon DNACOMMON_SOURCES)
|
||||
list(APPEND DNACOMMON_SOURCES ${liblist})
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef __DNACOMMON_ITWEAK_HPP__
|
||||
#define __DNACOMMON_ITWEAK_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
struct ITweak : BigYAML
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
#endif // __DNACOMMON_ITWEAK_HPP__
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef __DNACOMMON_ITWEAKGAME_HPP__
|
||||
#define __DNACOMMON_ITWEAKGAME_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakGame : BigYAML
|
||||
struct ITweakGame : ITweak
|
||||
{
|
||||
virtual const std::string& GetWorldPrefix() const = 0;
|
||||
virtual bool GetSplashScreensDisabled() const = 0;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef __DNACOMMON_ITWEAKGUI_HPP__
|
||||
#define __DNACOMMON_ITWEAKGUI_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
#include "zeus/CVector2f.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakGui : BigYAML
|
||||
struct ITweakGui : ITweak
|
||||
{
|
||||
virtual float GetScanSpeed(int idx) const=0;
|
||||
virtual float GetXrayBlurScaleLinear() const=0;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef __DNACOMMON_ITWEAKGUNRES_HPP__
|
||||
#define __DNACOMMON_ITWEAKGUNRES_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
#include "Runtime/IFactory.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakGunRes : BigYAML
|
||||
struct ITweakGunRes : ITweak
|
||||
{
|
||||
using ResId = int64_t;
|
||||
enum class EBeamId
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef __DNACOMMON_ITWEAKPARTICLE_HPP__
|
||||
#define __DNACOMMON_ITWEAKPARTICLE_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakParticle : BigYAML
|
||||
struct ITweakParticle : ITweak
|
||||
{
|
||||
};
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef __DNACOMMON_ITWEAKPLAYER_HPP__
|
||||
#define __DNACOMMON_ITWEAKPLAYER_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakPlayer : BigYAML
|
||||
struct ITweakPlayer : ITweak
|
||||
{
|
||||
virtual float GetX50() const=0;
|
||||
virtual float GetX54() const=0;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef __DNACOMMON_ITWEAKPLAYERCONTROL_HPP__
|
||||
#define __DNACOMMON_ITWEAKPLAYERCONTROL_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakPlayerControl : BigYAML
|
||||
struct ITweakPlayerControl : ITweak
|
||||
{
|
||||
virtual atUint32 GetMapping(atUint32) const=0;
|
||||
};
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef __DNACOMMON_ITWEAKPLAYERGUN_HPP__
|
||||
#define __DNACOMMON_ITWEAKPLAYERGUN_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakPlayerGun : BigYAML
|
||||
struct ITweakPlayerGun : ITweak
|
||||
{
|
||||
virtual float GetSomething1() const=0; // x24
|
||||
virtual float GetSomething2() const=0; // x28
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef __DNACOMMON_ITWEAKPLAYERRES_HPP__
|
||||
#define __DNACOMMON_ITWEAKPLAYERRES_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
#include "Runtime/IFactory.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakPlayerRes : BigYAML
|
||||
struct ITweakPlayerRes : ITweak
|
||||
{
|
||||
using ResId = int64_t;
|
||||
enum class EBeamId
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef __DNACOMMON_ITWEAKSLIDESHOW_HPP__
|
||||
#define __DNACOMMON_ITWEAKSLIDESHOW_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "ITweak.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakSlideShow : BigYAML
|
||||
struct ITweakSlideShow : ITweak
|
||||
{
|
||||
virtual const std::string& GetFont() const=0;
|
||||
virtual const zeus::CColor& GetFontColor() const=0;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef __DNACOMMON_ITWEAKTARGETING_HPP__
|
||||
#define __DNACOMMON_ITWEAKTARGETING_HPP__
|
||||
|
||||
#include "ITweak.hpp"
|
||||
namespace DataSpec
|
||||
{
|
||||
struct ITweakTargeting : public ITweak
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
#endif // __DNACOMMON_ITWEAKTARGETING_HPP__
|
|
@ -28,7 +28,8 @@ make_dnalist(liblist DNAMP1
|
|||
Tweaks/CTweakPlayerRes
|
||||
Tweaks/CTweakGui
|
||||
Tweaks/CTweakSlideShow
|
||||
Tweaks/CTweakCameraBob)
|
||||
Tweaks/CTweakCameraBob
|
||||
Tweaks/CTweakTargeting)
|
||||
|
||||
set(DNAMP1_SOURCES
|
||||
DNAMP1.hpp DNAMP1.cpp
|
||||
|
@ -48,7 +49,8 @@ set(DNAMP1_SOURCES
|
|||
SCLY.hpp SCLY.cpp
|
||||
FRME.cpp
|
||||
DeafBabe.cpp
|
||||
Tweaks/CTweakPlayer.cpp)
|
||||
Tweaks/CTweakPlayer.cpp
|
||||
Tweaks/CTweakTargeting.cpp)
|
||||
|
||||
dataspec_add_list(DNAMP1 DNAMP1_SOURCES)
|
||||
list(APPEND DNAMP1_SOURCES ${liblist})
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef _DNAMP1_CTWEAKTARGETING_HPP_
|
||||
#define _DNAMP1_CTWEAKTARGETING_HPP_
|
||||
|
||||
#include "../../DNACommon/Tweaks/ITweakTargeting.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP1
|
||||
{
|
||||
struct CTweakTargeting : public ITweakTargeting
|
||||
{
|
||||
DECL_YAML
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // _DNAMP1_CTWEAKTARGETING_HPP_
|
|
@ -1,108 +1,148 @@
|
|||
#include "CParticleGenInfo.hpp"
|
||||
#include "Graphics/IRenderer.hpp"
|
||||
#include "Particle/CParticleGen.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
#include "World/CGameLight.hpp"
|
||||
#include "CStateManager.hpp"
|
||||
#include "Graphics/CBooRenderer.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
CParticleGenInfo::CParticleGenInfo(const SObjectTag& part, int frameCount, const std::string& boneName,
|
||||
const zeus::CVector3f& scale, CParticleData::EParentedMode parentMode,
|
||||
int a)
|
||||
: x4_part(part), xc_seconds(frameCount / 60.f), x10_boneName(boneName), x28_parentMode(parentMode),
|
||||
x2c_a(a), x30_particleScale(scale)
|
||||
{}
|
||||
|
||||
static TUniqueId _initializeLight(const std::weak_ptr<CParticleGen>& system,
|
||||
CStateManager& stateMgr, int lightId)
|
||||
const zeus::CVector3f& scale, CParticleData::EParentedMode parentMode, int a, int b)
|
||||
: x4_part(part)
|
||||
, xc_seconds(frameCount / 60.f)
|
||||
, x10_boneName(boneName)
|
||||
, x28_parentMode(parentMode)
|
||||
, x2c_a(a)
|
||||
, x30_particleScale(scale)
|
||||
, x80_(b)
|
||||
{
|
||||
}
|
||||
|
||||
static TUniqueId _initializeLight(const std::weak_ptr<CParticleGen>& system, CStateManager& stateMgr, TAreaId areaId,
|
||||
int lightId)
|
||||
{
|
||||
TUniqueId ret = kInvalidUniqueId;
|
||||
std::shared_ptr<CParticleGen> systemRef = system.lock();
|
||||
if (systemRef->SystemHasLight())
|
||||
{
|
||||
|
||||
ret = stateMgr.AllocateUniqueId();
|
||||
stateMgr.AddObject(
|
||||
new CGameLight(ret, areaId, false, "ParticleLight",
|
||||
zeus::CTransform(systemRef->GetOrientation().buildMatrix3f(), systemRef->GetTranslation()),
|
||||
kInvalidUniqueId, systemRef->GetLight(), lightId, 0, 0.f));
|
||||
}
|
||||
return kInvalidUniqueId;
|
||||
return ret;
|
||||
}
|
||||
|
||||
CParticleGenInfoGeneric::CParticleGenInfoGeneric(const SObjectTag& part,
|
||||
const std::weak_ptr<CParticleGen>& system,
|
||||
CParticleGenInfoGeneric::CParticleGenInfoGeneric(const SObjectTag& part, const std::weak_ptr<CParticleGen>& system,
|
||||
int frameCount, const std::string& boneName,
|
||||
const zeus::CVector3f& scale,
|
||||
CParticleData::EParentedMode parentMode,
|
||||
int a, CStateManager& stateMgr, int lightId)
|
||||
: CParticleGenInfo(part, frameCount, boneName, scale, parentMode, a), x80_system(system)
|
||||
const zeus::CVector3f& scale, CParticleData::EParentedMode parentMode,
|
||||
int a, CStateManager& stateMgr, TAreaId areaId, int lightId, int b)
|
||||
: CParticleGenInfo(part, frameCount, boneName, scale, parentMode, a, b), x84_system(system)
|
||||
{
|
||||
if (lightId == -1)
|
||||
x84_lightId = kInvalidUniqueId;
|
||||
x88_lightId = kInvalidUniqueId;
|
||||
else
|
||||
x84_lightId = _initializeLight(system, stateMgr, lightId);
|
||||
x88_lightId = _initializeLight(system, stateMgr, lightId, areaId);
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::AddToRenderer()
|
||||
{
|
||||
}
|
||||
void CParticleGenInfoGeneric::AddToRenderer() { g_Renderer->AddParticleGen(*x84_system.get()); }
|
||||
|
||||
void CParticleGenInfoGeneric::Render()
|
||||
{
|
||||
}
|
||||
void CParticleGenInfoGeneric::Render() { x84_system->Render(); }
|
||||
|
||||
void CParticleGenInfoGeneric::Update(float dt, CStateManager& stateMgr)
|
||||
{
|
||||
x84_system->Update(dt);
|
||||
|
||||
if (x88_lightId != kInvalidUniqueId)
|
||||
{
|
||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
||||
if (gl)
|
||||
gl->SetLight(x84_system->GetLight());
|
||||
}
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::SetOrientation(const zeus::CTransform& xf, CStateManager& stateMgr)
|
||||
{
|
||||
x84_system->SetOrientation(xf);
|
||||
|
||||
if (x88_lightId != kInvalidUniqueId)
|
||||
{
|
||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
||||
if (gl)
|
||||
gl->SetRotation(zeus::CQuaternion(xf.buildMatrix3f()));
|
||||
}
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::SetTranslation(const zeus::CVector3f& trans, CStateManager& stateMgr)
|
||||
{
|
||||
x84_system->SetTranslation(trans);
|
||||
|
||||
if (x88_lightId != kInvalidUniqueId)
|
||||
{
|
||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
||||
if (gl)
|
||||
gl->SetTranslation(trans);
|
||||
}
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::SetGlobalOrientation(const zeus::CTransform& xf, CStateManager& stateMgr)
|
||||
{
|
||||
x84_system->SetGlobalOrientation(xf);
|
||||
|
||||
if (x88_lightId != kInvalidUniqueId)
|
||||
{
|
||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
||||
if (gl)
|
||||
gl->SetRotation(zeus::CQuaternion(xf.buildMatrix3f()));
|
||||
}
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::SetGlobalTranslation(const zeus::CVector3f& trans, CStateManager& stateMgr)
|
||||
{
|
||||
}
|
||||
x84_system->SetGlobalTranslation(trans);
|
||||
|
||||
void CParticleGenInfoGeneric::SetGlobalScale(const zeus::CVector3f& scale)
|
||||
if (x88_lightId != kInvalidUniqueId)
|
||||
{
|
||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
||||
if (gl)
|
||||
gl->SetTranslation(trans);
|
||||
}
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::SetParticleEmission(bool, CStateManager& stateMgr)
|
||||
void CParticleGenInfoGeneric::SetGlobalScale(const zeus::CVector3f& scale) { x84_system->SetGlobalScale(scale); }
|
||||
|
||||
void CParticleGenInfoGeneric::SetParticleEmission(bool emission, CStateManager& stateMgr)
|
||||
{
|
||||
x84_system->SetParticleEmission(emission);
|
||||
|
||||
TCastToPtr<CGameLight> gl(stateMgr.ObjectById(x88_lightId));
|
||||
|
||||
if (gl)
|
||||
gl->SetActive(emission);
|
||||
}
|
||||
|
||||
bool CParticleGenInfoGeneric::IsSystemDeletable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
zeus::CAABox CParticleGenInfoGeneric::GetBounds() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
bool CParticleGenInfoGeneric::HasActiveParticles() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::DestroyParticles()
|
||||
{
|
||||
}
|
||||
|
||||
bool CParticleGenInfoGeneric::HasLight() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TUniqueId CParticleGenInfoGeneric::GetLightId() const
|
||||
{
|
||||
return kInvalidUniqueId;
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::SetModulationColor(const zeus::CColor& color)
|
||||
bool CParticleGenInfoGeneric::IsSystemDeletable() const { return x84_system->IsSystemDeletable(); }
|
||||
|
||||
rstl::optional_object<zeus::CAABox> CParticleGenInfoGeneric::GetBounds() const { return x84_system->GetBounds(); }
|
||||
|
||||
bool CParticleGenInfoGeneric::HasActiveParticles() const { return x84_system->GetParticleCount() != 0; }
|
||||
|
||||
void CParticleGenInfoGeneric::DestroyParticles() { x84_system->DestroyParticles(); }
|
||||
|
||||
bool CParticleGenInfoGeneric::HasLight() const { return x84_system->SystemHasLight(); }
|
||||
|
||||
TUniqueId CParticleGenInfoGeneric::GetLightId() const { return x88_lightId; }
|
||||
|
||||
void CParticleGenInfoGeneric::DeleteLight(CStateManager& mgr)
|
||||
{
|
||||
if (x88_lightId != kInvalidUniqueId)
|
||||
mgr.DeleteObjectRequest(x88_lightId);
|
||||
}
|
||||
|
||||
void CParticleGenInfoGeneric::SetModulationColor(const zeus::CColor& color) { x84_system->SetModulationColor(color); }
|
||||
}
|
||||
|
|
|
@ -24,11 +24,13 @@ class CParticleGenInfo
|
|||
zeus::CVector3f x30_particleScale;
|
||||
float x3c_ = 0.f;
|
||||
bool x40_ = false;
|
||||
zeus::CTransform x44_;
|
||||
zeus::CVector3f x74_;
|
||||
zeus::CTransform x44_transform;
|
||||
zeus::CVector3f x74_offset;
|
||||
s32 x80_;
|
||||
|
||||
public:
|
||||
CParticleGenInfo(const SObjectTag& part, int frameCount, const std::string& boneName,
|
||||
const zeus::CVector3f&, CParticleData::EParentedMode parentMode, int a);
|
||||
CParticleGenInfo(const SObjectTag& part, int frameCount, const std::string& boneName, const zeus::CVector3f&,
|
||||
CParticleData::EParentedMode parentMode, int a, int b);
|
||||
|
||||
virtual ~CParticleGenInfo() = default;
|
||||
virtual void AddToRenderer() = 0;
|
||||
|
@ -41,23 +43,42 @@ public:
|
|||
virtual void SetGlobalScale(const zeus::CVector3f& scale) = 0;
|
||||
virtual void SetParticleEmission(bool, CStateManager& stateMgr) = 0;
|
||||
virtual bool IsSystemDeletable() const = 0;
|
||||
virtual zeus::CAABox GetBounds() const=0;
|
||||
virtual rstl::optional_object<zeus::CAABox> GetBounds() const = 0;
|
||||
virtual bool HasActiveParticles() const = 0;
|
||||
virtual void DestroyParticles() = 0;
|
||||
virtual bool HasLight() const = 0;
|
||||
virtual TUniqueId GetLightId() const = 0;
|
||||
virtual void DeleteLight(CStateManager&) const = 0;
|
||||
virtual void SetModulationColor(const zeus::CColor& color) = 0;
|
||||
|
||||
void SetFlags(s32);
|
||||
s32 GetFlags() const;
|
||||
void SetIsGrabInitialData(bool);
|
||||
bool GetIsGrabInitialData() const;
|
||||
bool GetIsActive() const;
|
||||
bool SetIsActive(bool);
|
||||
void OffsetTime(float);
|
||||
void SetCurOffset(const zeus::CVector3f& offset) { x74_offset = offset; }
|
||||
void SetCurTransform(const zeus::CTransform& xf) { x44_transform = xf; }
|
||||
void SetInactiveStartTime(float);
|
||||
float GetInactiveStartTime() const;
|
||||
float GetFinishTime() const;
|
||||
float GetCurrentTime() const;
|
||||
|
||||
CParticleData::EParentedMode GetParentedMode() const { return x28_parentMode; }
|
||||
const std::string& GetLocatorName() const { return x10_boneName; }
|
||||
};
|
||||
|
||||
class CParticleGenInfoGeneric : public CParticleGenInfo
|
||||
{
|
||||
std::shared_ptr<CParticleGen> x80_system;
|
||||
TUniqueId x84_lightId;
|
||||
std::shared_ptr<CParticleGen> x84_system;
|
||||
TUniqueId x88_lightId;
|
||||
|
||||
public:
|
||||
CParticleGenInfoGeneric(const SObjectTag& part, const std::weak_ptr<CParticleGen>& system,
|
||||
int, const std::string& boneName, const zeus::CVector3f& scale,
|
||||
CParticleData::EParentedMode parentMode, int a, CStateManager& stateMgr,
|
||||
int lightId);
|
||||
CParticleGenInfoGeneric(const SObjectTag& part, const std::weak_ptr<CParticleGen>& system, int,
|
||||
const std::string& boneName, const zeus::CVector3f& scale,
|
||||
CParticleData::EParentedMode parentMode, int a, CStateManager& stateMgr, TAreaId,
|
||||
int lightId, int b);
|
||||
|
||||
void AddToRenderer();
|
||||
void Render();
|
||||
|
@ -69,14 +90,14 @@ public:
|
|||
void SetGlobalScale(const zeus::CVector3f& scale);
|
||||
void SetParticleEmission(bool, CStateManager& stateMgr);
|
||||
bool IsSystemDeletable() const;
|
||||
zeus::CAABox GetBounds() const;
|
||||
rstl::optional_object<zeus::CAABox> GetBounds() const;
|
||||
bool HasActiveParticles() const;
|
||||
void DestroyParticles();
|
||||
bool HasLight() const;
|
||||
TUniqueId GetLightId() const;
|
||||
void DeleteLight(CStateManager&);
|
||||
void SetModulationColor(const zeus::CColor& color);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __URDE_CPARTICLEGENINFO_HPP__
|
||||
|
|
|
@ -483,11 +483,11 @@ void CBooRenderer::PostRenderFogs()
|
|||
|
||||
void CBooRenderer::AddParticleGen(const CParticleGen& gen)
|
||||
{
|
||||
std::pair<zeus::CAABox, bool> bounds = gen.GetBounds();
|
||||
if (bounds.second)
|
||||
auto bounds = gen.GetBounds();
|
||||
if (bounds)
|
||||
{
|
||||
zeus::CVector3f pt = bounds.first.closestPointAlongVector(xb0_viewPlane.vec);
|
||||
Buckets::Insert(pt, bounds.first, EDrawableType::Particle, &gen, xb0_viewPlane, 0);
|
||||
zeus::CVector3f pt = bounds.value().closestPointAlongVector(xb0_viewPlane.vec);
|
||||
Buckets::Insert(pt, bounds.value(), EDrawableType::Particle, &gen, xb0_viewPlane, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,14 +58,14 @@ class CGameGlobalObjects
|
|||
std::unique_ptr<CGameState> x134_gameState;
|
||||
TLockedToken<CStringTable> x13c_mainStringTable;
|
||||
CInGameTweakManager x150_tweakManager;
|
||||
std::unique_ptr<CBooRenderer> m_renderer;
|
||||
std::unique_ptr<IRenderer> m_renderer;
|
||||
|
||||
void LoadStringTable()
|
||||
{
|
||||
x13c_mainStringTable = g_SimplePool->GetObj("STRG_Main");
|
||||
g_MainStringTable = x13c_mainStringTable.GetObj();
|
||||
}
|
||||
static CBooRenderer*
|
||||
static IRenderer*
|
||||
AllocateRenderer(IObjectStore& store, IFactory& resFactory)
|
||||
{
|
||||
g_Renderer = new CBooRenderer(store, resFactory);
|
||||
|
|
|
@ -1152,41 +1152,41 @@ void CElementGen::BuildParticleSystemBounds()
|
|||
|
||||
for (std::unique_ptr<CElementGen>& ch : x234_activePartChildren)
|
||||
{
|
||||
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
|
||||
if (chBounds.second)
|
||||
auto chBounds = ch->GetBounds();
|
||||
if (chBounds)
|
||||
{
|
||||
accumulated = true;
|
||||
aabb.accumulateBounds(chBounds.first);
|
||||
aabb.accumulateBounds(chBounds.value());
|
||||
}
|
||||
}
|
||||
|
||||
for (std::unique_ptr<CElementGen>& ch : x248_finishPartChildren)
|
||||
{
|
||||
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
|
||||
if (chBounds.second)
|
||||
auto chBounds = ch->GetBounds();
|
||||
if (chBounds)
|
||||
{
|
||||
accumulated = true;
|
||||
aabb.accumulateBounds(chBounds.first);
|
||||
aabb.accumulateBounds(chBounds.value());
|
||||
}
|
||||
}
|
||||
|
||||
for (std::unique_ptr<CParticleSwoosh>& ch : x260_swhcChildren)
|
||||
{
|
||||
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
|
||||
if (chBounds.second)
|
||||
auto chBounds = ch->GetBounds();
|
||||
if (chBounds)
|
||||
{
|
||||
accumulated = true;
|
||||
aabb.accumulateBounds(chBounds.first);
|
||||
aabb.accumulateBounds(chBounds.value());
|
||||
}
|
||||
}
|
||||
|
||||
for (std::unique_ptr<CParticleElectric>& ch : x280_elscChildren)
|
||||
{
|
||||
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
|
||||
if (chBounds.second)
|
||||
auto chBounds = ch->GetBounds();
|
||||
if (chBounds)
|
||||
{
|
||||
accumulated = true;
|
||||
aabb.accumulateBounds(chBounds.first);
|
||||
aabb.accumulateBounds(chBounds.value());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2245,12 +2245,12 @@ bool CElementGen::IsSystemDeletable() const
|
|||
return false;
|
||||
}
|
||||
|
||||
std::pair<zeus::CAABox, bool> CElementGen::GetBounds() const
|
||||
rstl::optional_object<zeus::CAABox> CElementGen::GetBounds() const
|
||||
{
|
||||
if (GetParticleCountAll() == 0)
|
||||
return {zeus::CAABox(), false};
|
||||
return {zeus::CAABox()};
|
||||
else
|
||||
return {x2c4_systemBounds, true};
|
||||
return {x2c4_systemBounds};
|
||||
}
|
||||
|
||||
u32 CElementGen::GetParticleCount() const
|
||||
|
|
|
@ -232,7 +232,7 @@ public:
|
|||
const zeus::CVector3f& GetGlobalScale() const;
|
||||
const zeus::CColor& GetModulationColor() const;
|
||||
bool IsSystemDeletable() const;
|
||||
std::pair<zeus::CAABox, bool> GetBounds() const;
|
||||
rstl::optional_object<zeus::CAABox> GetBounds() const;
|
||||
u32 GetParticleCount() const;
|
||||
bool SystemHasLight() const;
|
||||
CLight GetLight() const;
|
||||
|
|
|
@ -185,9 +185,9 @@ bool CParticleElectric::IsSystemDeletable() const
|
|||
return false;
|
||||
}
|
||||
|
||||
std::pair<zeus::CAABox, bool> CParticleElectric::GetBounds() const
|
||||
rstl::optional_object<zeus::CAABox> CParticleElectric::GetBounds() const
|
||||
{
|
||||
return std::make_pair(zeus::CAABox(), false);
|
||||
return {};
|
||||
}
|
||||
|
||||
u32 CParticleElectric::GetParticleCount() const
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
const zeus::CVector3f& GetGlobalScale() const;
|
||||
const zeus::CColor& GetModulationColor() const;
|
||||
bool IsSystemDeletable() const;
|
||||
std::pair<zeus::CAABox, bool> GetBounds() const;
|
||||
rstl::optional_object<zeus::CAABox> GetBounds() const;
|
||||
u32 GetParticleCount() const;
|
||||
bool SystemHasLight() const;
|
||||
CLight GetLight() const;
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
virtual const zeus::CVector3f& GetGlobalScale() const=0;
|
||||
virtual const zeus::CColor& GetModulationColor() const=0;
|
||||
virtual bool IsSystemDeletable() const=0;
|
||||
virtual std::pair<zeus::CAABox, bool> GetBounds() const=0;
|
||||
virtual rstl::optional_object<zeus::CAABox> GetBounds() const=0;
|
||||
virtual u32 GetParticleCount() const=0;
|
||||
virtual bool SystemHasLight() const=0;
|
||||
virtual CLight GetLight() const=0;
|
||||
|
|
|
@ -88,9 +88,9 @@ bool CParticleSwoosh::IsSystemDeletable() const
|
|||
return false;
|
||||
}
|
||||
|
||||
std::pair<zeus::CAABox, bool> CParticleSwoosh::GetBounds() const
|
||||
rstl::optional_object<zeus::CAABox> CParticleSwoosh::GetBounds() const
|
||||
{
|
||||
return std::make_pair(zeus::CAABox(), false);
|
||||
return {};
|
||||
}
|
||||
|
||||
u32 CParticleSwoosh::GetParticleCount() const
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
const zeus::CVector3f& GetGlobalScale() const;
|
||||
const zeus::CColor& GetModulationColor() const;
|
||||
bool IsSystemDeletable() const;
|
||||
std::pair<zeus::CAABox, bool> GetBounds() const;
|
||||
rstl::optional_object<zeus::CAABox> GetBounds() const;
|
||||
u32 GetParticleCount() const;
|
||||
bool SystemHasLight() const;
|
||||
CLight GetLight() const;
|
||||
|
|
|
@ -253,6 +253,14 @@ void CActor::SetSfxPitchBend(s32 val)
|
|||
CSfxManager::PitchBend(*x8c_sfxHandle.get(), val);
|
||||
}
|
||||
|
||||
void CActor::SetRotation(const zeus::CQuaternion &q)
|
||||
{
|
||||
x34_transform = q.toTransform(x34_transform.origin);
|
||||
xe4_27_ = true;
|
||||
xe4_28_ = true;
|
||||
xe4_29_ = true;
|
||||
}
|
||||
|
||||
void CActor::SetTranslation(const zeus::CVector3f& tr)
|
||||
{
|
||||
x34_transform.origin = tr;
|
||||
|
|
|
@ -140,6 +140,7 @@ public:
|
|||
bool HasModelData() const;
|
||||
const CSfxHandle* GetSfxHandle() const;
|
||||
void SetSfxPitchBend(s32);
|
||||
void SetRotation(const zeus::CQuaternion& q);
|
||||
void SetTranslation(const zeus::CVector3f& tr);
|
||||
void SetAddedToken(u32 tok);
|
||||
float GetPitch() const;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "CGameLight.hpp"
|
||||
#include "CActorParameters.hpp"
|
||||
#include "World/CGameLight.hpp"
|
||||
#include "World/CActorParameters.hpp"
|
||||
#include "CStateManager.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
@ -9,20 +10,25 @@ CGameLight::CGameLight(TUniqueId uid, TAreaId aid, bool active, const std::strin
|
|||
TUniqueId parentId, const CLight& light, u32 w1, 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_(w1), x140_(w2), x144_(f1)
|
||||
xe8_parentId(parentId), xec_light(light), x13c_(w1), x140_(w2), x144_lifeTime(f1)
|
||||
{
|
||||
xec_light.GetRadius();
|
||||
xec_light.GetIntensity();
|
||||
SetLightPriorityAndId();
|
||||
}
|
||||
|
||||
void CGameLight::Accept(IVisitor &visitor)
|
||||
{
|
||||
visitor.Visit(this);
|
||||
}
|
||||
|
||||
void CGameLight::Think(float dt, CStateManager& mgr)
|
||||
{
|
||||
if (x144_ <= 0.f)
|
||||
if (x144_lifeTime <= 0.f)
|
||||
return;
|
||||
x144_ -= dt;
|
||||
x144_lifeTime -= dt;
|
||||
|
||||
if (x144_ <= 0.f)
|
||||
if (x144_lifeTime <= 0.f)
|
||||
mgr.RemoveActor(GetUniqueId());
|
||||
}
|
||||
|
||||
|
|
|
@ -11,12 +11,13 @@ class CGameLight : public CActor
|
|||
CLight xec_light;
|
||||
u32 x13c_;
|
||||
u32 x140_;
|
||||
float x144_;
|
||||
float x144_lifeTime;
|
||||
|
||||
public:
|
||||
CGameLight(TUniqueId, TAreaId, bool, const std::string&, const zeus::CTransform&, TUniqueId, const CLight&, u32,
|
||||
u32, float);
|
||||
|
||||
void Accept(IVisitor &visitor);
|
||||
void Think(float, CStateManager&);
|
||||
void SetLightPriorityAndId();
|
||||
void SetLight(const CLight&);
|
||||
|
|
|
@ -23,7 +23,7 @@ CLight CWorldLight::GetAsCGraphicsLight() const
|
|||
zeus::CColor color(x4_color.x, x4_color.y, x4_color.z);
|
||||
float tmp = x28_q;
|
||||
if (epsilon < tmp)
|
||||
tmp = 0.0000011920929f;
|
||||
tmp = 0.000001f;
|
||||
/*
|
||||
if (x0_type == ELightType::Spot)
|
||||
{
|
||||
|
|
2
specter
2
specter
|
@ -1 +1 @@
|
|||
Subproject commit 03e7124c5f576033c10ad2d0a116e4a331c0381d
|
||||
Subproject commit a4761350329459605dfb98d7eb27d453e6da2d29
|
Loading…
Reference in New Issue