Match and link CEffectComponent

Former-commit-id: d72c176ac7
This commit is contained in:
Phillip Stephens 2023-01-11 11:40:36 -08:00
parent 2bd5aa55f8
commit a4052ad963
3 changed files with 49 additions and 1 deletions

View File

@ -664,7 +664,7 @@ LIBS = [
"Kyoto/Graphics/DolphinCModel", "Kyoto/Graphics/DolphinCModel",
["Kyoto/Text/CStringTable", True], ["Kyoto/Text/CStringTable", True],
"Kyoto/Particles/CEmitterElement", "Kyoto/Particles/CEmitterElement",
"Kyoto/Particles/CEffectComponent", ["Kyoto/Particles/CEffectComponent", True],
["Kyoto/Particles/CParticleData", False], ["Kyoto/Particles/CParticleData", False],
"Kyoto/Animation/CVertexMorphEffect", "Kyoto/Animation/CVertexMorphEffect",
"Kyoto/Animation/CSkinnedModelWithAvgNormals", "Kyoto/Animation/CSkinnedModelWithAvgNormals",

View File

@ -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

View File

@ -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<float>())
, x2c_parentedMode(CParticleData::EParentedMode(in.Get<uint>()))
, x30_flags(in.Get<uint>()) {}
SObjectTag CEffectComponent::GetSObjectTagFromStream(CInputStream& in) {
const FourCC type = in.Get<CAssetId>();
const CAssetId id = in.Get<CAssetId>();
return SObjectTag(type, id);
}