From a9ed8c432947176b3460020d0eb9f9fe57261598 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 16 Sep 2020 04:33:36 -0400 Subject: [PATCH] CAnimData: Actually create CParticleData in InitializeEffects --- Runtime/Character/CAnimData.cpp | 10 +++++----- Runtime/Character/CParticleData.hpp | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Runtime/Character/CAnimData.cpp b/Runtime/Character/CAnimData.cpp index a4957a835..ebbba498e 100644 --- a/Runtime/Character/CAnimData.cpp +++ b/Runtime/Character/CAnimData.cpp @@ -101,8 +101,10 @@ void CAnimData::InitializeEffects(CStateManager& mgr, TAreaId aId, const zeus::C for (const auto& effects : xc_charInfo.GetEffectList()) { for (const auto& effect : effects.second) { x120_particleDB.CacheParticleDesc(effect.GetParticleTag()); - x120_particleDB.AddParticleEffect(effect.GetSegmentName(), effect.GetFlags(), CParticleData(), scale, mgr, aId, - true, x21c_particleLightIdx); + const CParticleData data{effect.GetParticleTag(), effect.GetSegmentName(), effect.GetScale(), + effect.GetParentedMode()}; + x120_particleDB.AddParticleEffect(effect.GetComponentName(), effect.GetFlags(), data, scale, mgr, aId, true, + x21c_particleLightIdx); x120_particleDB.SetParticleEffectState(effect.GetComponentName(), false, mgr); } } @@ -258,9 +260,7 @@ std::shared_ptr CAnimData::GetAnimationManager() { return x10 void CAnimData::SetPhase(float ph) { x1f8_animRoot->VSetPhase(ph); } -void CAnimData::Touch(const CSkinnedModel& model, int shadIdx) const { - model.GetModelInst()->Touch(shadIdx); -} +void CAnimData::Touch(const CSkinnedModel& model, int shadIdx) const { model.GetModelInst()->Touch(shadIdx); } SAdvancementDeltas CAnimData::GetAdvancementDeltas(const CCharAnimTime& a, const CCharAnimTime& b) const { return x1f8_animRoot->VGetAdvancementResults(a, b).x8_deltas; diff --git a/Runtime/Character/CParticleData.hpp b/Runtime/Character/CParticleData.hpp index 98428e200..7ba389327 100644 --- a/Runtime/Character/CParticleData.hpp +++ b/Runtime/Character/CParticleData.hpp @@ -22,6 +22,8 @@ private: public: CParticleData() = default; + CParticleData(const SObjectTag& tag, std::string_view boneName, float scale, EParentedMode mode) + : x4_particle(tag), xc_boneName(boneName), x1c_scale(scale), x20_parentMode(mode) {} explicit CParticleData(CInputStream& in); u32 GetDuration() const { return x0_duration; } const SObjectTag& GetTag() const { return x4_particle; }