ANCS stubs and initial readers

This commit is contained in:
Jack Andersen 2016-04-10 11:22:59 -10:00
parent 457ee8f3af
commit fc6cb2ec33
64 changed files with 1073 additions and 2 deletions

View File

@ -10,6 +10,7 @@
#include "Runtime/Graphics/CModel.hpp"
#include "Runtime/Graphics/CTexture.hpp"
#include "Runtime/Character/CCharLayoutInfo.hpp"
#include "Runtime/Character/CAnimCharacterSet.hpp"
#include "DataSpec/DNACommon/TXTR.hpp"
@ -31,6 +32,7 @@ ProjectResourceFactoryMP1::ProjectResourceFactoryMP1(hecl::ClientProcess& client
m_factoryMgr.AddFactory(FOURCC('FONT'), FFactoryFunc(FRasterFontFactory));
m_factoryMgr.AddFactory(FOURCC('CMDL'), FMemFactoryFunc(FModelFactory));
m_factoryMgr.AddFactory(FOURCC('CINF'), FFactoryFunc(FCharLayoutInfo));
m_factoryMgr.AddFactory(FOURCC('ANCS'), FFactoryFunc(FAnimCharacterSet));
}
void ProjectResourceFactoryMP1::IndexMP1Resources(hecl::Database::Project& proj)

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREEANIMREADERCONTAINER_HPP__
#define __PSHAG_CANIMTREEANIMREADERCONTAINER_HPP__
namespace urde
{
class CAnimTreeAnimReaderContainer
{
};
}
#endif // __PSHAG_CANIMTREEANIMREADERCONTAINER_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREEBLEND_HPP__
#define __PSHAG_CANIMTREEBLEND_HPP__
namespace urde
{
class CAnimTreeBlend
{
};
}
#endif // __PSHAG_CANIMTREEBLEND_HPP__

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREEDOUBLECHILD_HPP__
#define __PSHAG_CANIMTREEDOUBLECHILD_HPP__
namespace urde
{
class CAnimTreeDoubleChild
{
};
}
#endif // __PSHAG_CANIMTREEDOUBLECHILD_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREELOOPIN_HPP__
#define __PSHAG_CANIMTREELOOPIN_HPP__
namespace urde
{
class CAnimTreeLoopIn
{
};
}
#endif // __PSHAG_CANIMTREELOOPIN_HPP__

View File

View File

@ -0,0 +1,15 @@
#ifndef __PSHAG_CANIMTREENODE_HPP__
#define __PSHAG_CANIMTREENODE_HPP__
#include "IAnimReader.hpp"
namespace urde
{
class CAnimTreeNode : public IAnimReader
{
};
}
#endif // __PSHAG_CANIMTREENODE_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREESCALE_HPP__
#define __PSHAG_CANIMTREESCALE_HPP__
namespace urde
{
class CAnimTreeScale
{
};
}
#endif // __PSHAG_CANIMTREESCALE_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREESEQUENCE_HPP__
#define __PSHAG_CANIMTREESEQUENCE_HPP__
namespace urde
{
class CAnimTreeSequence
{
};
}
#endif // __PSHAG_CANIMTREESEQUENCE_HPP__

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREESINGLECHILD_HPP__
#define __PSHAG_CANIMTREESINGLECHILD_HPP__
namespace urde
{
class CAnimTreeSingleChild
{
};
}
#endif // __PSHAG_CANIMTREESINGLECHILD_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREETIMESCALE_HPP__
#define __PSHAG_CANIMTREETIMESCALE_HPP__
namespace urde
{
class CAnimTreeTimeScale
{
};
}
#endif // __PSHAG_CANIMTREETIMESCALE_HPP__

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREETRANSITION_HPP__
#define __PSHAG_CANIMTREETRANSITION_HPP__
namespace urde
{
class CAnimTreeTransition
{
};
}
#endif // __PSHAG_CANIMTREETRANSITION_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CANIMTREETWEENBASE_HPP__
#define __PSHAG_CANIMTREETWEENBASE_HPP__
namespace urde
{
class CAnimTreeTweenBase
{
};
}
#endif // __PSHAG_CANIMTREETWEENBASE_HPP__

View File

@ -0,0 +1,13 @@
#include "CAnimation.hpp"
#include "CMetaAnimFactory.hpp"
namespace urde
{
CAnimation::CAnimation(CInputStream& in)
{
x0_name = in.readString();
x10_anim = CMetaAnimFactory::CreateMetaAnim(in);
}
}

View File

@ -0,0 +1,21 @@
#ifndef __PSHAG_CANIMATION_HPP__
#define __PSHAG_CANIMATION_HPP__
#include "IOStreams.hpp"
#include "CMetaAnimFactory.hpp"
namespace urde
{
class IMetaAnim;
class CAnimation
{
std::string x0_name;
std::shared_ptr<IMetaAnim> x10_anim;
public:
CAnimation(CInputStream& in);
};
}
#endif // __PSHAG_CANIMATION_HPP__

View File

@ -0,0 +1,55 @@
#include "CAnimationSet.hpp"
#include "CMetaTransFactory.hpp"
namespace urde
{
CAnimationSet::CAnimationSet(CInputStream& in)
: x0_tableCount(in.readUint16Big())
{
u32 animationCount = in.readUint32Big();
x4_animations.reserve(animationCount);
for (u32 i=0 ; i<animationCount ; ++i)
x4_animations.emplace_back(in);
u32 transitionCount = in.readUint32Big();
x14_transitions.reserve(transitionCount);
for (u32 i=0 ; i<transitionCount ; ++i)
x14_transitions.emplace_back(in);
x24_defaultTransition = CMetaTransFactory::CreateMetaTrans(in);
if (x0_tableCount > 1)
{
u32 additiveAnimCount = in.readUint32Big();
x28_additiveInfo.reserve(additiveAnimCount);
for (u32 i=0 ; i<additiveAnimCount ; ++i)
{
u32 id = in.readUint32Big();
x28_additiveInfo.emplace_back(id, in);
}
x38_defaultAdditiveInfo.read(in);
}
if (x0_tableCount > 2)
{
u32 halfTransitionCount = in.readUint32Big();
x40_halfTransitions.reserve(halfTransitionCount);
for (u32 i=0 ; i<halfTransitionCount ; ++i)
x40_halfTransitions.emplace_back(in);
}
if (x0_tableCount > 3)
{
u32 animResourcesCount = in.readUint32Big();
x50_animRes.reserve(animResourcesCount);
for (u32 i=0 ; i<animResourcesCount ; ++i)
{
TResId anim = in.readUint32Big();
TResId evnt = in.readUint32Big();
x50_animRes.emplace_back(anim, evnt);
}
}
}
}

View File

@ -2,12 +2,38 @@
#define __PSHAG_CANIMATIONSET_HPP__
#include "IOStreams.hpp"
#include "CAnimation.hpp"
#include "CTransition.hpp"
#include "CHalfTransition.hpp"
namespace urde
{
class CAdditiveAnimationInfo
{
float x0_a = 0.f;
float x4_b = 0.f;
public:
void read(CInputStream& in)
{
x0_a = in.readFloatBig();
x4_b = in.readFloatBig();
}
CAdditiveAnimationInfo() = default;
CAdditiveAnimationInfo(CInputStream& in) {read(in);}
};
class CAnimationSet
{
u16 x0_tableCount;
std::vector<CAnimation> x4_animations;
std::vector<CTransition> x14_transitions;
std::shared_ptr<IMetaTrans> x24_defaultTransition;
std::vector<std::pair<u32, CAdditiveAnimationInfo>> x28_additiveInfo;
CAdditiveAnimationInfo x38_defaultAdditiveInfo;
std::vector<CHalfTransition> x40_halfTransitions;
std::vector<std::pair<TResId, TResId>> x50_animRes;
public:
CAnimationSet(CInputStream& in);
};

View File

@ -3,6 +3,32 @@
namespace urde
{
CCharacterInfo::CParticleResData::CParticleResData(CInputStream& in, u16 tableCount)
{
u32 partCount = in.readUint32Big();
x0_part.reserve(partCount);
for (u32 i=0 ; i<partCount ; ++i)
x0_part.push_back(in.readUint32Big());
u32 swhcCount = in.readUint32Big();
x10_swhc.reserve(swhcCount);
for (u32 i=0 ; i<swhcCount ; ++i)
x10_swhc.push_back(in.readUint32Big());
u32 unkCount = in.readUint32Big();
x20_.reserve(unkCount);
for (u32 i=0 ; i<unkCount ; ++i)
x20_.push_back(in.readUint32Big());
if (tableCount > 5)
{
u32 elscCount = in.readUint32Big();
x30_elsc.reserve(elscCount);
for (u32 i=0 ; i<elscCount ; ++i)
x30_elsc.push_back(in.readUint32Big());
}
}
static std::vector<std::pair<u32, std::pair<std::string, std::string>>>
MakeAnimInfoVector(CInputStream& in)
{
@ -26,7 +52,51 @@ CCharacterInfo::CCharacterInfo(CInputStream& in)
x18_cskr(in.readUint32Big()),
x1c_cinf(in.readUint32Big()),
x20_animInfo(MakeAnimInfoVector(in)),
x30_pasDatabase(in)
{}
x30_pasDatabase(in),
x44_partRes(in, x0_tableCount),
x84_unk(in.readUint32Big())
{
if (x0_tableCount > 1)
{
u32 aabbCount = in.readUint32Big();
x88_aabbs.reserve(aabbCount);
for (u32 i=0 ; i<aabbCount ; ++i)
{
std::string name = in.readString();
x88_aabbs.emplace_back(name, zeus::CAABox());
x88_aabbs.back().second.readBoundingBoxBig(in);
}
}
if (x0_tableCount > 2)
{
u32 effectCount = in.readUint32Big();
x98_effects.reserve(effectCount);
for (u32 i=0 ; i<effectCount ; ++i)
{
std::string name = in.readString();
x98_effects.emplace_back(name, std::vector<CEffectComponent>());
std::vector<CEffectComponent>& comps = x98_effects.back().second;
u32 compCount = in.readUint32Big();
comps.reserve(compCount);
for (u32 j=0 ; j<compCount ; ++i)
comps.emplace_back(in);
}
}
if (x0_tableCount > 3)
{
xa8_cmdlOverlay = in.readUint32Big();
xac_cskrOverlay = in.readUint32Big();
}
if (x0_tableCount > 4)
{
u32 aidxCount = in.readUint32Big();
xb0_animIdxs.reserve(aidxCount);
for (u32 i=0 ; i<aidxCount ; ++i)
xb0_animIdxs.push_back(in.readUint32Big());
}
}
}

View File

@ -3,12 +3,24 @@
#include "IOStreams.hpp"
#include "CPASDatabase.hpp"
#include "zeus/CAABox.hpp"
#include "CEffectComponent.hpp"
namespace urde
{
class CCharacterInfo
{
public:
struct CParticleResData
{
std::vector<TResId> x0_part;
std::vector<TResId> x10_swhc;
std::vector<TResId> x20_;
std::vector<TResId> x30_elsc;
CParticleResData(CInputStream& in, u16 tableCount);
};
private:
u16 x0_tableCount;
std::string x4_name;
TResId x14_cmdl;
@ -16,6 +28,15 @@ class CCharacterInfo
TResId x1c_cinf;
std::vector<std::pair<u32, std::pair<std::string, std::string>>> x20_animInfo;
CPASDatabase x30_pasDatabase;
CParticleResData x44_partRes;
u32 x84_unk;
std::vector<std::pair<std::string, zeus::CAABox>> x88_aabbs;
std::vector<std::pair<std::string, std::vector<CEffectComponent>>> x98_effects;
TResId xa8_cmdlOverlay = 0;
TResId xac_cskrOverlay = 0;
std::vector<u32> xb0_animIdxs;
public:
CCharacterInfo(CInputStream& in);

View File

@ -0,0 +1,23 @@
#include "CEffectComponent.hpp"
namespace urde
{
SObjectTag CEffectComponent::GetSObjectTagFromStream(CInputStream& in)
{
char tpChars[4];
in.readBytesToBuf(tpChars, 4);
return {tpChars, in.readUint32Big()};
}
CEffectComponent::CEffectComponent(CInputStream& in)
{
x0_name = in.readString();
x10_tag = GetSObjectTagFromStream(in);
x18_boneName = in.readString();
x28_ = in.readFloatBig();
x2c_ = in.readUint32Big();
x30_ = in.readUint32Big();
}
}

View File

@ -0,0 +1,24 @@
#ifndef __PSHAG_CEFFECTCOMPONENT_HPP__
#define __PSHAG_CEFFECTCOMPONENT_HPP__
#include "IOStreams.hpp"
namespace urde
{
class CEffectComponent
{
std::string x0_name;
SObjectTag x10_tag;
std::string x18_boneName;
float x28_;
u32 x2c_;
u32 x30_;
static SObjectTag GetSObjectTagFromStream(CInputStream& in);
public:
CEffectComponent(CInputStream& in);
};
}
#endif // __PSHAG_CEFFECTCOMPONENT_HPP__

View File

@ -0,0 +1,13 @@
#include "CHalfTransition.hpp"
#include "CMetaTransFactory.hpp"
namespace urde
{
CHalfTransition::CHalfTransition(CInputStream& in)
{
x0_id = in.readUint32Big();
x4_trans = CMetaTransFactory::CreateMetaTrans(in);
}
}

View File

@ -0,0 +1,20 @@
#ifndef __PSHAG_CHALFTRANSITION_HPP__
#define __PSHAG_CHALFTRANSITION_HPP__
#include "IOStreams.hpp"
#include "IMetaTrans.hpp"
namespace urde
{
class CHalfTransition
{
u32 x0_id;
std::shared_ptr<IMetaTrans> x4_trans;
public:
CHalfTransition(CInputStream& in);
};
}
#endif // __PSHAG_CHALFTRANSITION_HPP__

View File

@ -25,4 +25,32 @@ add_library(RuntimeCommonCharacter
CPASParmInfo.hpp CPASParmInfo.cpp
CPASAnimInfo.hpp CPASAnimInfo.cpp
CPASAnimParm.hpp CPASAnimParm.cpp
CEffectComponent.hpp CEffectComponent.cpp
CAnimation.hpp CAnimation.cpp
CTransition.hpp CTransition.cpp
CMetaAnimFactory.hpp CMetaAnimFactory.cpp
CMetaAnimPlay.hpp CMetaAnimPlay.cpp
CMetaAnimBlend.hpp CMetaAnimBlend.cpp
CMetaAnimPhaseBlend.hpp CMetaAnimPhaseBlend.cpp
CMetaAnimRandom.hpp CMetaAnimRandom.cpp
CMetaAnimSequence.hpp CMetaAnimSequence.cpp
CMetaTransFactory.hpp CMetaTransFactory.cpp
CMetaTransMetaAnim.hpp CMetaTransMetaAnim.cpp
CMetaTransTrans.hpp CMetaTransTrans.cpp
CMetaTransPhaseTrans.hpp CMetaTransPhaseTrans.cpp
CMetaTransSnap.hpp CMetaTransSnap.cpp
CAnimTreeLoopIn.hpp CAnimTreeLoopIn.cpp
CAnimTreeSequence.hpp CAnimTreeSequence.cpp
CAnimTreeAnimReaderContainer.hpp CAnimTreeAnimReaderContainer.cpp
CAnimTreeBlend.hpp CAnimTreeBlend.cpp
CAnimTreeNode.hpp CAnimTreeNode.cpp
CAnimTreeScale.hpp CAnimTreeScale.cpp
CAnimTreeTimeScale.hpp CAnimTreeTimeScale.cpp
CAnimTreeTransition.hpp CAnimTreeTransition.cpp
CAnimTreeTweenBase.hpp CAnimTreeTweenBase.cpp
CAnimTreeSingleChild.hpp CAnimTreeSingleChild.cpp
CAnimTreeDoubleChild.hpp CAnimTreeDoubleChild.cpp
IAnimReader.hpp IAnimReader.cpp
CPrimitive.hpp CPrimitive.cpp
CHalfTransition.hpp CHalfTransition.cpp
CBodyState.hpp)

View File

@ -0,0 +1,26 @@
#include "CMetaAnimBlend.hpp"
namespace urde
{
CMetaAnimBlend::CMetaAnimBlend(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimBlend::GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
void CMetaAnimBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimBlend::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
}

View File

@ -0,0 +1,25 @@
#ifndef __PSHAG_CMETAANIMBLEND_HPP__
#define __PSHAG_CMETAANIMBLEND_HPP__
#include "IMetaAnim.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaAnimBlend : public IMetaAnim
{
public:
CMetaAnimBlend(CInputStream& in);
EMetaAnimType GetType() const {return EMetaAnimType::Blend;}
std::shared_ptr<CAnimTreeNode> GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
void GetUniquePrimitives(std::set<CPrimitive>& primsOut) const;
std::shared_ptr<CAnimTreeNode> VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
};
}
#endif // __PSHAG_CMETAANIMBLEND_HPP__

View File

@ -0,0 +1,33 @@
#include "CMetaAnimFactory.hpp"
#include "CMetaAnimPlay.hpp"
#include "CMetaAnimBlend.hpp"
#include "CMetaAnimPhaseBlend.hpp"
#include "CMetaAnimRandom.hpp"
#include "CMetaAnimSequence.hpp"
namespace urde
{
std::shared_ptr<IMetaAnim> CMetaAnimFactory::CreateMetaAnim(CInputStream& in)
{
EMetaAnimType type = EMetaAnimType(in.readUint32Big());
switch (type)
{
case EMetaAnimType::Primitive:
return std::make_shared<CMetaAnimPlay>(in);
case EMetaAnimType::Blend:
return std::make_shared<CMetaAnimBlend>(in);
case EMetaAnimType::PhaseBlend:
return std::make_shared<CMetaAnimPhaseBlend>(in);
case EMetaAnimType::Random:
return std::make_shared<CMetaAnimRandom>(in);
case EMetaAnimType::Sequence:
return std::make_shared<CMetaAnimSequence>(in);
default: break;
}
return {};
}
}

View File

@ -0,0 +1,18 @@
#ifndef __PSHAG_CMETAANIMFACTORY_HPP__
#define __PSHAG_CMETAANIMFACTORY_HPP__
#include "IOStreams.hpp"
#include "IMetaAnim.hpp"
namespace urde
{
class CMetaAnimFactory
{
public:
static std::shared_ptr<IMetaAnim> CreateMetaAnim(CInputStream& in);
};
}
#endif // __PSHAG_CMETAANIMFACTORY_HPP__

View File

@ -0,0 +1,26 @@
#include "CMetaAnimPhaseBlend.hpp"
namespace urde
{
CMetaAnimPhaseBlend::CMetaAnimPhaseBlend(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimPhaseBlend::GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
void CMetaAnimPhaseBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimPhaseBlend::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
}

View File

@ -0,0 +1,25 @@
#ifndef __PSHAG_CMETAANIMPHASEBLEND_HPP__
#define __PSHAG_CMETAANIMPHASEBLEND_HPP__
#include "IMetaAnim.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaAnimPhaseBlend : public IMetaAnim
{
public:
CMetaAnimPhaseBlend(CInputStream& in);
EMetaAnimType GetType() const {return EMetaAnimType::PhaseBlend;}
std::shared_ptr<CAnimTreeNode> GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
void GetUniquePrimitives(std::set<CPrimitive>& primsOut) const;
std::shared_ptr<CAnimTreeNode> VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
};
}
#endif // __PSHAG_CMETAANIMPHASEBLEND_HPP__

View File

@ -0,0 +1,26 @@
#include "CMetaAnimPlay.hpp"
namespace urde
{
CMetaAnimPlay::CMetaAnimPlay(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimPlay::GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
void CMetaAnimPlay::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimPlay::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
}

View File

@ -0,0 +1,25 @@
#ifndef __PSHAG_CMETAANIMPLAY_HPP__
#define __PSHAG_CMETAANIMPLAY_HPP__
#include "IMetaAnim.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaAnimPlay : public IMetaAnim
{
public:
CMetaAnimPlay(CInputStream& in);
EMetaAnimType GetType() const {return EMetaAnimType::Primitive;}
std::shared_ptr<CAnimTreeNode> GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
void GetUniquePrimitives(std::set<CPrimitive>& primsOut) const;
std::shared_ptr<CAnimTreeNode> VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
};
}
#endif // __PSHAG_CMETAANIMPLAY_HPP__

View File

@ -0,0 +1,26 @@
#include "CMetaAnimRandom.hpp"
namespace urde
{
CMetaAnimRandom::CMetaAnimRandom(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimRandom::GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
void CMetaAnimRandom::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimRandom::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
}

View File

@ -0,0 +1,25 @@
#ifndef __PSHAG_CMETAANIMRANDOM_HPP__
#define __PSHAG_CMETAANIMRANDOM_HPP__
#include "IMetaAnim.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaAnimRandom : public IMetaAnim
{
public:
CMetaAnimRandom(CInputStream& in);
EMetaAnimType GetType() const {return EMetaAnimType::Random;}
std::shared_ptr<CAnimTreeNode> GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
void GetUniquePrimitives(std::set<CPrimitive>& primsOut) const;
std::shared_ptr<CAnimTreeNode> VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
};
}
#endif // __PSHAG_CMETAANIMRANDOM_HPP__

View File

@ -0,0 +1,26 @@
#include "CMetaAnimSequence.hpp"
namespace urde
{
CMetaAnimSequence::CMetaAnimSequence(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimSequence::GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
void CMetaAnimSequence::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const
{
}
std::shared_ptr<CAnimTreeNode>
CMetaAnimSequence::VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const
{
}
}

View File

@ -0,0 +1,25 @@
#ifndef __PSHAG_CMETAANIMSEQUENCE_HPP__
#define __PSHAG_CMETAANIMSEQUENCE_HPP__
#include "IMetaAnim.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaAnimSequence : public IMetaAnim
{
public:
CMetaAnimSequence(CInputStream& in);
EMetaAnimType GetType() const {return EMetaAnimType::Sequence;}
std::shared_ptr<CAnimTreeNode> GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
void GetUniquePrimitives(std::set<CPrimitive>& primsOut) const;
std::shared_ptr<CAnimTreeNode> VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const;
};
}
#endif // __PSHAG_CMETAANIMSEQUENCE_HPP__

View File

@ -0,0 +1,30 @@
#include "CMetaTransFactory.hpp"
#include "CMetaTransMetaAnim.hpp"
#include "CMetaTransTrans.hpp"
#include "CMetaTransPhaseTrans.hpp"
#include "CMetaTransSnap.hpp"
namespace urde
{
std::shared_ptr<IMetaTrans> CMetaTransFactory::CreateMetaTrans(CInputStream& in)
{
EMetaTransType type = EMetaTransType(in.readUint32Big());
switch (type)
{
case EMetaTransType::MetaAnim:
return std::make_shared<CMetaTransMetaAnim>(in);
case EMetaTransType::Trans:
return std::make_shared<CMetaTransTrans>(in);
case EMetaTransType::PhaseTrans:
return std::make_shared<CMetaTransPhaseTrans>(in);
case EMetaTransType::Snap:
return std::make_shared<CMetaTransSnap>(in);
default: break;
}
return {};
}
}

View File

@ -0,0 +1,18 @@
#ifndef __PSHAG_CMETATRANSFACTORY_HPP__
#define __PSHAG_CMETATRANSFACTORY_HPP__
#include "IOStreams.hpp"
#include "IMetaTrans.hpp"
namespace urde
{
class CMetaTransFactory
{
public:
static std::shared_ptr<IMetaTrans> CreateMetaTrans(CInputStream& in);
};
}
#endif // __PSHAG_CMETATRANSFACTORY_HPP__

View File

@ -0,0 +1,17 @@
#include "CMetaTransMetaAnim.hpp"
namespace urde
{
CMetaTransMetaAnim::CMetaTransMetaAnim(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaTransMetaAnim::VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const
{
}
}

View File

@ -0,0 +1,23 @@
#ifndef __PSHAG_CMETATRANSMETAANIM_HPP__
#define __PSHAG_CMETATRANSMETAANIM_HPP__
#include "IMetaTrans.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaTransMetaAnim : public IMetaTrans
{
public:
CMetaTransMetaAnim(CInputStream& in);
EMetaTransType GetType() const {return EMetaTransType::MetaAnim;}
std::shared_ptr<CAnimTreeNode> VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const;
};
}
#endif // __PSHAG_CMETATRANSMETAANIM_HPP__

View File

@ -0,0 +1,17 @@
#include "CMetaTransPhaseTrans.hpp"
namespace urde
{
CMetaTransPhaseTrans::CMetaTransPhaseTrans(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaTransPhaseTrans::VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const
{
}
}

View File

@ -0,0 +1,23 @@
#ifndef __PSHAG_CMETATRANSPHASETRANS_HPP__
#define __PSHAG_CMETATRANSPHASETRANS_HPP__
#include "IMetaTrans.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaTransPhaseTrans : public IMetaTrans
{
public:
CMetaTransPhaseTrans(CInputStream& in);
EMetaTransType GetType() const {return EMetaTransType::PhaseTrans;}
std::shared_ptr<CAnimTreeNode> VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const;
};
}
#endif // __PSHAG_CMETATRANSPHASETRANS_HPP__

View File

@ -0,0 +1,17 @@
#include "CMetaTransSnap.hpp"
namespace urde
{
CMetaTransSnap::CMetaTransSnap(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaTransSnap::VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const
{
}
}

View File

@ -0,0 +1,23 @@
#ifndef __PSHAG_CMETATRANSSNAP_HPP__
#define __PSHAG_CMETATRANSSNAP_HPP__
#include "IMetaTrans.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaTransSnap : public IMetaTrans
{
public:
CMetaTransSnap(CInputStream& in);
EMetaTransType GetType() const {return EMetaTransType::Snap;}
std::shared_ptr<CAnimTreeNode> VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const;
};
}
#endif // __PSHAG_CMETATRANSSNAP_HPP__

View File

@ -0,0 +1,17 @@
#include "CMetaTransTrans.hpp"
namespace urde
{
CMetaTransTrans::CMetaTransTrans(CInputStream& in)
{
}
std::shared_ptr<CAnimTreeNode>
CMetaTransTrans::VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const
{
}
}

View File

@ -0,0 +1,23 @@
#ifndef __PSHAG_CMETATRANSTRANS_HPP__
#define __PSHAG_CMETATRANSTRANS_HPP__
#include "IMetaTrans.hpp"
#include "IOStreams.hpp"
namespace urde
{
class CMetaTransTrans : public IMetaTrans
{
public:
CMetaTransTrans(CInputStream& in);
EMetaTransType GetType() const {return EMetaTransType::Trans;}
std::shared_ptr<CAnimTreeNode> VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const;
};
}
#endif // __PSHAG_CMETATRANSTRANS_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_CPRIMITIVE_HPP__
#define __PSHAG_CPRIMITIVE_HPP__
namespace urde
{
class CPrimitive
{
};
}
#endif // __PSHAG_CPRIMITIVE_HPP__

View File

@ -0,0 +1,10 @@
#include "CTransition.hpp"
namespace urde
{
CTransition::CTransition(CInputStream& in)
{
}
}

View File

@ -0,0 +1,22 @@
#ifndef __PSHAG_CTRANSITION_HPP__
#define __PSHAG_CTRANSITION_HPP__
#include "IOStreams.hpp"
#include "CMetaTransFactory.hpp"
namespace urde
{
class CTransition
{
u32 x0_id;
u32 x4_animA;
u32 x8_animB;
std::unique_ptr<IMetaTrans> xc_trans;
public:
CTransition(CInputStream& in);
};
}
#endif // __PSHAG_CTRANSITION_HPP__

View File

View File

@ -0,0 +1,13 @@
#ifndef __PSHAG_IANIMREADER_HPP__
#define __PSHAG_IANIMREADER_HPP__
namespace urde
{
class IAnimReader
{
};
}
#endif // __PSHAG_IANIMREADER_HPP__

View File

@ -2,12 +2,34 @@
#define __PSHAG_IMETAANIM_HPP__
#include "../RetroTypes.hpp"
#include <set>
namespace urde
{
class CAnimTreeNode;
class CAnimSysContext;
class CMetaAnimTreeBuildOrders;
class CPrimitive;
enum class EMetaAnimType
{
Primitive,
Blend,
PhaseBlend,
Random,
Sequence
};
class IMetaAnim
{
public:
virtual ~IMetaAnim() = default;
virtual std::shared_ptr<CAnimTreeNode> GetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const=0;
virtual void GetUniquePrimitives(std::set<CPrimitive>& primsOut) const=0;
virtual EMetaAnimType GetType() const=0;
virtual std::shared_ptr<CAnimTreeNode> VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const=0;
};
}

View File

@ -5,9 +5,25 @@
namespace urde
{
class CAnimTreeNode;
class CAnimSysContext;
enum class EMetaTransType
{
MetaAnim,
Trans,
PhaseTrans,
Snap,
};
class IMetaTrans
{
public:
virtual ~IMetaTrans() = default;
virtual std::shared_ptr<CAnimTreeNode> VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const=0;
virtual EMetaTransType GetType() const=0;
};
}