Update boo, fixes and initial imps

This commit is contained in:
Phillip Stephens 2017-11-24 00:01:06 -08:00
parent 41edf5a226
commit c6fdd8297e
11 changed files with 50 additions and 13 deletions

View File

@ -97,6 +97,20 @@ CAnimData::CAnimData(CAssetId id,
x1f8_animRoot = treeNode; x1f8_animRoot = treeNode;
} }
void CAnimData::InitializeEffects(CStateManager& mgr, TAreaId aId, const zeus::CVector3f& scale)
{
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);
x120_particleDB.SetParticleEffectState(effect.GetComponentName(), false, mgr);
}
}
}
CAssetId CAnimData::GetEventResourceIdForAnimResourceId(CAssetId id) const CAssetId CAnimData::GetEventResourceIdForAnimResourceId(CAssetId id) const
{ {
return x0_charFactory->GetEventResourceIdForAnimResourceId(id); return x0_charFactory->GetEventResourceIdForAnimResourceId(id);

View File

@ -165,6 +165,7 @@ public:
const TLockedToken<CCharacterFactory>& charFactory, const TLockedToken<CCharacterFactory>& charFactory,
int drawInstCount); int drawInstCount);
void InitializeEffects(CStateManager&, TAreaId, const zeus::CVector3f&);
CAssetId GetEventResourceIdForAnimResourceId(CAssetId) const; CAssetId GetEventResourceIdForAnimResourceId(CAssetId) const;
void AddAdditiveSegData(const CSegIdList& list, CSegStatementSet& stSet); void AddAdditiveSegData(const CSegIdList& list, CSegStatementSet& stSet);
static SAdvancementResults AdvanceAdditiveAnim(std::shared_ptr<CAnimTreeNode>& anim, const CCharAnimTime& time); static SAdvancementResults AdvanceAdditiveAnim(std::shared_ptr<CAnimTreeNode>& anim, const CCharAnimTime& time);

View File

@ -12,6 +12,7 @@ namespace urde
class CCharacterInfo class CCharacterInfo
{ {
friend class CAnimData; friend class CAnimData;
public: public:
struct CParticleResData struct CParticleResData
{ {
@ -21,6 +22,7 @@ public:
std::vector<CAssetId> x30_elsc; std::vector<CAssetId> x30_elsc;
CParticleResData(CInputStream& in, u16 tableCount); CParticleResData(CInputStream& in, u16 tableCount);
}; };
private: private:
u16 x0_tableCount; u16 x0_tableCount;
std::string x4_name; std::string x4_name;
@ -43,20 +45,23 @@ public:
CCharacterInfo(CInputStream& in); CCharacterInfo(CInputStream& in);
std::string_view GetCharacterName() const { return x4_name; } std::string_view GetCharacterName() const { return x4_name; }
CAssetId GetModelId() const {return x14_cmdl;} CAssetId GetModelId() const { return x14_cmdl; }
CAssetId GetSkinRulesId() const {return x18_cskr;} CAssetId GetSkinRulesId() const { return x18_cskr; }
CAssetId GetCharLayoutInfoId() const {return x1c_cinf;} CAssetId GetCharLayoutInfoId() const { return x1c_cinf; }
const std::vector<std::pair<std::string, zeus::CAABox>>& GetAnimBBoxList() const { return x88_aabbs; } const std::vector<std::pair<std::string, zeus::CAABox>>& GetAnimBBoxList() const { return x88_aabbs; }
const std::vector<std::pair<std::string, std::vector<CEffectComponent>>>& GetEffectList() const
{
return x98_effects;
}
CAssetId GetIceModelId() const {return xa8_cmdlOverlay;} CAssetId GetIceModelId() const { return xa8_cmdlOverlay; }
CAssetId GetIceSkinRulesId() const {return xac_cskrOverlay;} CAssetId GetIceSkinRulesId() const { return xac_cskrOverlay; }
const CParticleResData& GetParticleResData() const {return x44_partRes;} const CParticleResData& GetParticleResData() const { return x44_partRes; }
u32 GetAnimationIndex(u32 idx) const { return xb0_animIdxs.at(idx); } u32 GetAnimationIndex(u32 idx) const { return xb0_animIdxs.at(idx); }
const CPASDatabase& GetPASDatabase() const { return x30_pasDatabase; } const CPASDatabase& GetPASDatabase() const { return x30_pasDatabase; }
}; };
} }
#endif // __URDE_CCHARACTERINFO_HPP__ #endif // __URDE_CCHARACTERINFO_HPP__

View File

@ -14,12 +14,15 @@ CMetaAnimBlend::CMetaAnimBlend(CInputStream& in)
void CMetaAnimBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const void CMetaAnimBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{ {
x4_animA->GetUniquePrimitives(primsOut);
x4_animA->GetUniquePrimitives(primsOut);
} }
std::shared_ptr<CAnimTreeNode> std::shared_ptr<CAnimTreeNode>
CMetaAnimBlend::VGetAnimationTree(const CAnimSysContext& animSys, CMetaAnimBlend::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const const CMetaAnimTreeBuildOrders& orders) const
{ {
CMetaAnimTreeBuildOrders buildOrders = CMetaAnimTreeBuildOrders::NoSpecialOrders();
return {}; return {};
} }

View File

@ -14,6 +14,8 @@ CMetaAnimPhaseBlend::CMetaAnimPhaseBlend(CInputStream& in)
void CMetaAnimPhaseBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const void CMetaAnimPhaseBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{ {
x4_animA->GetUniquePrimitives(primsOut);
x8_animB->GetUniquePrimitives(primsOut);
} }
std::shared_ptr<CAnimTreeNode> std::shared_ptr<CAnimTreeNode>

View File

@ -24,6 +24,8 @@ CMetaAnimRandom::CMetaAnimRandom(CInputStream& in)
void CMetaAnimRandom::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const void CMetaAnimRandom::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{ {
for (const auto& pair : x4_randomData)
pair.first->GetUniquePrimitives(primsOut);
} }
std::shared_ptr<CAnimTreeNode> std::shared_ptr<CAnimTreeNode>

View File

@ -16,6 +16,11 @@ CParticleDatabase::CParticleDatabase()
xb4_25_drawingEnds = false; xb4_25_drawingEnds = false;
} }
void CParticleDatabase::CacheParticleDesc(const SObjectTag &tag)
{
}
void CParticleDatabase::CacheParticleDesc(const CCharacterInfo::CParticleResData& desc) void CParticleDatabase::CacheParticleDesc(const CCharacterInfo::CParticleResData& desc)
{ {
for (CAssetId id : desc.x0_part) for (CAssetId id : desc.x0_part)

View File

@ -47,6 +47,7 @@ class CParticleDatabase
std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map, bool deleteIfDone); std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map, bool deleteIfDone);
public: public:
CParticleDatabase(); CParticleDatabase();
void CacheParticleDesc(const SObjectTag& tag);
void CacheParticleDesc(const CCharacterInfo::CParticleResData& desc); void CacheParticleDesc(const CCharacterInfo::CParticleResData& desc);
void SetModulationColorAllActiveEffects(const zeus::CColor& color); void SetModulationColorAllActiveEffects(const zeus::CColor& color);
void SuspendAllActiveEffects(CStateManager& stateMgr); void SuspendAllActiveEffects(CStateManager& stateMgr);

View File

@ -55,7 +55,13 @@ struct CMetaAnimTreeBuildOrders
std::experimental::optional<CPreAdvanceIndicator> x0_; std::experimental::optional<CPreAdvanceIndicator> x0_;
std::experimental::optional<CPreAdvanceIndicator> x44_; std::experimental::optional<CPreAdvanceIndicator> x44_;
static CMetaAnimTreeBuildOrders NoSpecialOrders() { return {}; } static CMetaAnimTreeBuildOrders NoSpecialOrders() { return {}; }
void PreAdvanceForAll(const CPreAdvanceIndicator& ind) { x44_.emplace(ind); } static CMetaAnimTreeBuildOrders PreAdvanceForAll(const CPreAdvanceIndicator& ind)
{
CMetaAnimTreeBuildOrders ret;
ret.x0_.emplace(ind);
ret.x44_.emplace(ind);
return ret;
}
}; };
class IMetaAnim class IMetaAnim

View File

@ -55,17 +55,15 @@ void CActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMana
if (HasModelData() && x64_modelData->AnimationData()) if (HasModelData() && x64_modelData->AnimationData())
{ {
TAreaId aid = GetAreaId(); TAreaId aid = GetAreaId();
// x64_modelData->AnimationData()->sub_8002AE6C(mgr, aid, x64_modelData->x0_particleScale); x64_modelData->AnimationData()->InitializeEffects(mgr, aid, x64_modelData->GetScale());
} }
} }
break; break;
case EScriptObjectMessage::Deleted: // 34 case EScriptObjectMessage::Deleted: // 34
{ {
RemoveEmitter(); RemoveEmitter();
#if 0
if (HasModelData() && x64_modelData->AnimationData() && x64_modelData->GetNormalModel()) if (HasModelData() && x64_modelData->AnimationData() && x64_modelData->GetNormalModel())
x64_modelData->AnimationData()->GetParticleDB().GetActiveParticleLightIds(mgr); x64_modelData->AnimationData()->GetParticleDB().DeleteAllLights(mgr);
#endif
} }
break; break;
case EScriptObjectMessage::InitializedInArea: // 35 case EScriptObjectMessage::InitializedInArea: // 35

2
hecl

@ -1 +1 @@
Subproject commit 2bfe803bf63aa17af34adac7c7b317dc8c646467 Subproject commit f4dd74c50be1f6e557f72986dea84d27f10a3819