From d72c176ac70017bcac7dfe3768187a5dc0077851 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 11 Jan 2023 11:40:36 -0800 Subject: [PATCH] Match and link CEffectComponent --- configure.py | 2 +- include/Kyoto/Particles/CEffectComponent.hpp | 30 ++++++++++++++++++++ src/Kyoto/Particles/CEffectComponent.cpp | 18 ++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 include/Kyoto/Particles/CEffectComponent.hpp create mode 100644 src/Kyoto/Particles/CEffectComponent.cpp diff --git a/configure.py b/configure.py index 35a96249..895e9753 100755 --- a/configure.py +++ b/configure.py @@ -664,7 +664,7 @@ LIBS = [ "Kyoto/Graphics/DolphinCModel", ["Kyoto/Text/CStringTable", True], "Kyoto/Particles/CEmitterElement", - "Kyoto/Particles/CEffectComponent", + ["Kyoto/Particles/CEffectComponent", True], ["Kyoto/Particles/CParticleData", False], "Kyoto/Animation/CVertexMorphEffect", "Kyoto/Animation/CSkinnedModelWithAvgNormals", diff --git a/include/Kyoto/Particles/CEffectComponent.hpp b/include/Kyoto/Particles/CEffectComponent.hpp new file mode 100644 index 00000000..32071ffb --- /dev/null +++ b/include/Kyoto/Particles/CEffectComponent.hpp @@ -0,0 +1,30 @@ +#ifndef _CEFFECTCOMPONENT +#define _CEFFECTCOMPONENT + +#include "Kyoto/Particles/CParticleData.hpp" + +#include "rstl/string.hpp" + +class CEffectComponent { +public: + explicit CEffectComponent(CInputStream& in); + + const rstl::string& GetComponentName() const { return x0_name; } + const SObjectTag& GetParticleTag() const { return x10_tag; } + const rstl::string& GetSegmentName() const { return x18_boneName; } + float GetScale() const { return x28_scale; } + CParticleData::EParentedMode GetParentedMode() const { return x2c_parentedMode; } + uint GetFlags() const {return x30_flags; } + +private: + SObjectTag GetSObjectTagFromStream(CInputStream& in); + + rstl::string x0_name; + SObjectTag x10_tag; + rstl::string x18_boneName; + float x28_scale; + CParticleData::EParentedMode x2c_parentedMode; + uint x30_flags; +}; + +#endif // _CEFFECTCOMPONENT diff --git a/src/Kyoto/Particles/CEffectComponent.cpp b/src/Kyoto/Particles/CEffectComponent.cpp new file mode 100644 index 00000000..9037aea4 --- /dev/null +++ b/src/Kyoto/Particles/CEffectComponent.cpp @@ -0,0 +1,18 @@ +#include "Kyoto/Particles/CEffectComponent.hpp" + +#include "Kyoto/Streams/CInputStream.hpp" + +CEffectComponent::CEffectComponent(CInputStream& in) +: x0_name(in) +, x10_tag(GetSObjectTagFromStream(in)) +, x18_boneName(in) +, x28_scale(in.Get()) +, x2c_parentedMode(CParticleData::EParentedMode(in.Get())) +, x30_flags(in.Get()) {} + + +SObjectTag CEffectComponent::GetSObjectTagFromStream(CInputStream& in) { + const FourCC type = in.Get(); + const CAssetId id = in.Get(); + return SObjectTag(type, id); +}