diff --git a/DataSpec/DNAMP1/ANCS.hpp b/DataSpec/DNAMP1/ANCS.hpp index 1a0e37de5..5daef2e14 100644 --- a/DataSpec/DNAMP1/ANCS.hpp +++ b/DataSpec/DNAMP1/ANCS.hpp @@ -133,7 +133,7 @@ struct ANCS : BigYAML String<-1> name; DNAFourCC type; UniqueID32 id; - String<-1> name2; + String<-1> locator; Value unk1; Value unk2; Value unk3; diff --git a/Runtime/Character/CBodyState.hpp b/Runtime/Character/CBodyState.hpp new file mode 100644 index 000000000..9d4fec192 --- /dev/null +++ b/Runtime/Character/CBodyState.hpp @@ -0,0 +1,138 @@ +#ifndef CBODYSTATE_HPP +#define CBODYSTATE_HPP +#include "RetroTypes.hpp" + +namespace urde +{ +namespace pas +{ +enum class ELocomotionType +{ +}; + +enum class ELocomotionAnim +{ +}; + +} +class CBodyController; +class CStateManager; +class CBodyState +{ +public: + virtual bool IsInAir(const CBodyController&) const { return false; } + virtual bool IsDead() const { return false; } + virtual bool IsMoving() const { return false; } + virtual bool ApplyGravity() const { return true; } + virtual bool ApplyHeadTracking() const { return true; } + virtual bool ApplyAnimationDeltas() const { return true; } + virtual bool CanShoot() const { return false; } + virtual void Start(CBodyController&, CStateManager&) = 0; + virtual void UpdateBody(float, CBodyController&, CStateManager&) = 0; + virtual void Shutdown(CBodyController&)=0; +}; + +class CBSAttack : public CBodyState +{ +public: + virtual bool CanShoot() const { return false; } + virtual void Start(CBodyController &, CStateManager &) {} + virtual void UpdateBody(float, CBodyController &, CStateManager&); + virtual void Shutdown(CBodyController&) {} +}; + +class CBSDie : public CBodyState +{ + bool x8_isDead = false; +public: + bool IsDead() const { return x8_isDead; } + void Start(CBodyController &, CStateManager &) {} + void UpdateBody(float, CBodyController &, CStateManager&) {} + void Shutdown(CBodyController &) {} +}; + +class CBSFall : public CBodyState +{ +public: + void Start(CBodyController &, CStateManager &) {} + void UpdateBody(float, CBodyController &, CStateManager&) {} + void Shutdown(CBodyController &) {} +}; + +class CBSGetup : public CBodyState +{ +public: + void Start(CBodyController &, CStateManager &) {} + void UpdateBody(float, CBodyController &, CStateManager&) {} + void Shutdown(CBodyController &) {} +}; + +class CBSKnockBack : public CBodyState +{ +public: + bool IsMoving() const { return true; } + void Start(CBodyController &, CStateManager &) {} + void UpdateBody(float, CBodyController &, CStateManager&) {} + void Shutdown(CBodyController &) {} +}; + +class CBSLieOnGround : public CBodyState +{ +public: + void Start(CBodyController &, CStateManager &) {} + void UpdateBody(float, CBodyController &, CStateManager&) {} + void Shutdown(CBodyController &) {} +}; + +class CBSStep : public CBodyState +{ +public: + bool IsMoving() const { return true; } + bool CanShoot() const { return true; } + void Start(CBodyController &, CStateManager &) {} + void UpdateBody(float, CBodyController &, CStateManager&) {} + void Shutdown(CBodyController &) {} +}; + +class CBSTurn : public CBodyState +{ +public: + virtual bool CanShoot() const { return true; } + virtual void Start(CBodyController &, CStateManager &) {} + virtual void UpdateBody(float, CBodyController &, CStateManager&) {} + virtual void Shutdown(CBodyController &) {} + virtual void GetBodyStateTransition(float, CBodyController&); +}; + +class CBSFlyerTurn : public CBSTurn +{ +public: + virtual void Start(CBodyController &, CStateManager &) {} + virtual void UpdateBody(float, CBodyController &, CStateManager&) {} +}; + +class CBSLoopAttack : public CBodyState +{ +public: + virtual bool CanShoot() const { return true; } + virtual void Start(CBodyController &, CStateManager &) {} + virtual void UpdateBody(float, CBodyController &, CStateManager&); + virtual void Shutdown(CBodyController&) {} +}; + +class CBSLocomotion : public CBodyState +{ +public: + virtual bool IsMoving() const = 0; + virtual bool CanShoot() const { return true; } + virtual void Start(CBodyController &, CStateManager &) {} + virtual void UpdateBody(float, CBodyController &, CStateManager&) {} + virtual void Shutdown() const {} + virtual bool IsPitchable() const { return true; } + virtual float GetLocomotionSpeed(pas::ELocomotionType, pas::ELocomotionAnim) = 0; + virtual void ApplyLocomotionPysics(float, CBodyController&) {} + virtual void UpdateLocomotionAnimation(float, const CBodyController& )=0; + virtual void GetBodyStateTransition(float, CBodyState&) {} +}; +} +#endif // CBODYSTATE_HPP diff --git a/Runtime/Character/CMakeLists.txt b/Runtime/Character/CMakeLists.txt index a978ffaae..9c47b8238 100644 --- a/Runtime/Character/CMakeLists.txt +++ b/Runtime/Character/CMakeLists.txt @@ -11,4 +11,5 @@ add_library(RuntimeCommonCharacter CTransitionDatabaseGame.hpp CHierarchyPoseBuilder.hpp CHierarchyPoseBuilder.cpp CPoseAsTransforms.hpp CPoseAsTransforms.cpp - CVirtualBone.hpp CVirtualBone.cpp) + CVirtualBone.hpp CVirtualBone.cpp + CBodyState.hpp) diff --git a/Runtime/Particle/CDecalManager.cpp b/Runtime/Particle/CDecalManager.cpp index e69de29bb..0047536c9 100644 --- a/Runtime/Particle/CDecalManager.cpp +++ b/Runtime/Particle/CDecalManager.cpp @@ -0,0 +1,26 @@ +#include "CDecalManager.hpp" +#include "CDecalDescription.hpp" + +namespace urde +{ +bool CDecalManager::m_PoolInitialized = false; +s32 CDecalManager::m_FreeIndex = 63; +float CDecalManager::m_DeltaTimeSinceLastDecalCreation = 0.f; +s32 CDecalManager::m_LastDecalCreatedIndex = -1; +TResId CDecalManager::m_LastDecalCreatedAssetId = -1; + +void CDecalManager::Initialize() +{ + if (m_PoolInitialized) + return; + + m_DecalPool.clear(); + m_DecalPool.resize(64); + + m_FreeIndex = 63; + m_PoolInitialized = true; + m_DeltaTimeSinceLastDecalCreation = 0.f; + m_LastDecalCreatedIndex = -1; + m_LastDecalCreatedAssetId = -1; +} +} diff --git a/Runtime/Particle/CDecalManager.hpp b/Runtime/Particle/CDecalManager.hpp index 10278b053..742366fd9 100644 --- a/Runtime/Particle/CDecalManager.hpp +++ b/Runtime/Particle/CDecalManager.hpp @@ -1,15 +1,41 @@ #ifndef __PSHAG_CDECALMANAGER_HPP__ #define __PSHAG_CDECALMANAGER_HPP__ +#include "RetroTypes.hpp" +#include "rstl.hpp" +#include "optional.hpp" +#include "CToken.hpp" + namespace urde { -class CDecalManager +class CDecal { public: - static void Initialize() + class CQuadDecal { - } + }; +}; + +class CDecalManager +{ + struct SDecal + { + TAreaId m_areaId; + std::experimental::optional x60_decal; + SDecal() = default; + SDecal(std::experimental::optional&&, TAreaId); + }; + + static bool m_PoolInitialized; + static s32 m_FreeIndex; + static float m_DeltaTimeSinceLastDecalCreation; + static s32 m_LastDecalCreatedIndex; + static TResId m_LastDecalCreatedAssetId; + static rstl::reserved_vector m_DecalPool; + static rstl::reserved_vector m_ActiveIndexList; +public: + static void Initialize(); }; } diff --git a/Runtime/Particle/CParticleElectric.cpp b/Runtime/Particle/CParticleElectric.cpp index b16c74972..664d18592 100644 --- a/Runtime/Particle/CParticleElectric.cpp +++ b/Runtime/Particle/CParticleElectric.cpp @@ -138,7 +138,6 @@ void CParticleElectric::SetLocalScale(const zeus::CVector3f& scale) x438_28_x450_28 = true; if (x438_26_x450_26_HaveEPSM) { - } } diff --git a/Runtime/Particle/CParticleElectric.hpp b/Runtime/Particle/CParticleElectric.hpp index 8fadd2329..3e80cbc70 100644 --- a/Runtime/Particle/CParticleElectric.hpp +++ b/Runtime/Particle/CParticleElectric.hpp @@ -71,16 +71,18 @@ private: u8 dummy = 0; }; - void RenderSwooshes(); public: CParticleElectric(const TToken& desc); void SetupLineGXMaterial(); - void RenderLines(); void Update(double); + void RenderLines(); + void RenderSwooshes(); void Render(); + void CalculateFractal(s32, s32, float, float); + void CalculatePoints(); void SetOrientation(const zeus::CTransform&); void SetTranslation(const zeus::CVector3f&); void SetGlobalOrientation(const zeus::CTransform&);