mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-18 01:15:26 +00:00
Cleanup & refactoring
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
class CAnimEventData : public CResource
|
||||
{
|
||||
DECLARE_RESOURCE_TYPE(eAnimEventData)
|
||||
DECLARE_RESOURCE_TYPE(AnimEventData)
|
||||
|
||||
struct SEvent
|
||||
{
|
||||
|
||||
@@ -45,12 +45,12 @@ struct SHalfTransition
|
||||
};
|
||||
|
||||
// Character structures
|
||||
enum EOverlayType
|
||||
enum class EOverlayType
|
||||
{
|
||||
eOT_Frozen = FOURCC('FRZN'),
|
||||
eOT_Hypermode = FOURCC('HYPR'),
|
||||
eOT_Acid = FOURCC('ACID'),
|
||||
eOT_XRay = FOURCC('XRAY')
|
||||
Frozen = FOURCC('FRZN'),
|
||||
Hypermode = FOURCC('HYPR'),
|
||||
Acid = FOURCC('ACID'),
|
||||
XRay = FOURCC('XRAY')
|
||||
};
|
||||
|
||||
struct SOverlayModel
|
||||
@@ -84,7 +84,7 @@ struct SSetCharacter
|
||||
|
||||
class CAnimSet : public CResource
|
||||
{
|
||||
DECLARE_RESOURCE_TYPE(eAnimSet)
|
||||
DECLARE_RESOURCE_TYPE(AnimSet)
|
||||
friend class CAnimSetLoader;
|
||||
|
||||
// Character Set
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
class CAnimation : public CResource
|
||||
{
|
||||
DECLARE_RESOURCE_TYPE(eAnimation)
|
||||
DECLARE_RESOURCE_TYPE(Animation)
|
||||
friend class CAnimationLoader;
|
||||
|
||||
typedef std::vector<CVector3f> TScaleChannel;
|
||||
|
||||
@@ -160,7 +160,7 @@ const SSetCharacter* CAnimationParameters::GetCurrentSetCharacter(int32 NodeInde
|
||||
{
|
||||
CAnimSet *pSet = AnimSet();
|
||||
|
||||
if (pSet && (pSet->Type() == eAnimSet || pSet->Type() == eCharacter))
|
||||
if (pSet && (pSet->Type() == EResourceType::AnimSet || pSet->Type() == EResourceType::Character))
|
||||
{
|
||||
if (NodeIndex == -1)
|
||||
NodeIndex = mCharIndex;
|
||||
@@ -215,7 +215,7 @@ void CAnimationParameters::SetResource(const CAssetID& rkID)
|
||||
|
||||
if (!pEntry)
|
||||
errorf("Invalid resource ID passed to CAnimationParameters: %s", *rkID.ToString());
|
||||
else if (pEntry->ResourceType() != eAnimSet && pEntry->ResourceType() != eCharacter)
|
||||
else if (pEntry->ResourceType() != EResourceType::AnimSet && pEntry->ResourceType() != EResourceType::Character)
|
||||
errorf("Resource with invalid type passed to CAnimationParameters: %s", *pEntry->CookedAssetPath().GetFileName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ struct SBoneTransformInfo
|
||||
|
||||
class CSkeleton : public CResource
|
||||
{
|
||||
DECLARE_RESOURCE_TYPE(eSkeleton)
|
||||
DECLARE_RESOURCE_TYPE(Skeleton)
|
||||
friend class CSkeletonLoader;
|
||||
|
||||
CBone *mpRootBone;
|
||||
|
||||
@@ -12,7 +12,7 @@ struct SVertexWeights
|
||||
|
||||
class CSkin : public CResource
|
||||
{
|
||||
DECLARE_RESOURCE_TYPE(eSkin)
|
||||
DECLARE_RESOURCE_TYPE(Skin)
|
||||
friend class CSkinLoader;
|
||||
|
||||
struct SVertGroup
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
class CSourceAnimData : public CResource
|
||||
{
|
||||
DECLARE_RESOURCE_TYPE(eSourceAnimData)
|
||||
DECLARE_RESOURCE_TYPE(SourceAnimData)
|
||||
friend class CAnimSetLoader;
|
||||
|
||||
struct STransition
|
||||
|
||||
@@ -5,21 +5,21 @@ CMetaAnimFactory gMetaAnimFactory;
|
||||
|
||||
IMetaAnimation* CMetaAnimFactory::LoadFromStream(IInputStream& rInput, EGame Game)
|
||||
{
|
||||
EMetaAnimationType Type = (EMetaAnimationType) rInput.ReadLong();
|
||||
EMetaAnimType Type = (EMetaAnimType) rInput.ReadLong();
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case eMAT_Play:
|
||||
case EMetaAnimType::Play:
|
||||
return new CMetaAnimPlay(rInput, Game);
|
||||
|
||||
case eMAT_Blend:
|
||||
case eMAT_PhaseBlend:
|
||||
case EMetaAnimType::Blend:
|
||||
case EMetaAnimType::PhaseBlend:
|
||||
return new CMetaAnimBlend(Type, rInput, Game);
|
||||
|
||||
case eMAT_Random:
|
||||
case EMetaAnimType::Random:
|
||||
return new CMetaAnimRandom(rInput, Game);
|
||||
|
||||
case eMAT_Sequence:
|
||||
case EMetaAnimType::Sequence:
|
||||
return new CMetaAnimSequence(rInput, Game);
|
||||
|
||||
default:
|
||||
@@ -43,9 +43,9 @@ CMetaAnimPlay::CMetaAnimPlay(IInputStream& rInput, EGame Game)
|
||||
mUnknownB = rInput.ReadLong();
|
||||
}
|
||||
|
||||
EMetaAnimationType CMetaAnimPlay::Type() const
|
||||
EMetaAnimType CMetaAnimPlay::Type() const
|
||||
{
|
||||
return eMAT_Play;
|
||||
return EMetaAnimType::Play;
|
||||
}
|
||||
|
||||
void CMetaAnimPlay::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const
|
||||
@@ -54,9 +54,9 @@ void CMetaAnimPlay::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) cons
|
||||
}
|
||||
|
||||
// ************ CMetaAnimBlend ************
|
||||
CMetaAnimBlend::CMetaAnimBlend(EMetaAnimationType Type, IInputStream& rInput, EGame Game)
|
||||
CMetaAnimBlend::CMetaAnimBlend(EMetaAnimType Type, IInputStream& rInput, EGame Game)
|
||||
{
|
||||
ASSERT(Type == eMAT_Blend || Type == eMAT_PhaseBlend);
|
||||
ASSERT(Type == EMetaAnimType::Blend || Type == EMetaAnimType::PhaseBlend);
|
||||
mType = Type;
|
||||
mpMetaAnimA = gMetaAnimFactory.LoadFromStream(rInput, Game);
|
||||
mpMetaAnimB = gMetaAnimFactory.LoadFromStream(rInput, Game);
|
||||
@@ -70,7 +70,7 @@ CMetaAnimBlend::~CMetaAnimBlend()
|
||||
delete mpMetaAnimB;
|
||||
}
|
||||
|
||||
EMetaAnimationType CMetaAnimBlend::Type() const
|
||||
EMetaAnimType CMetaAnimBlend::Type() const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
@@ -102,9 +102,9 @@ CMetaAnimRandom::~CMetaAnimRandom()
|
||||
delete mProbabilityPairs[iPair].pAnim;
|
||||
}
|
||||
|
||||
EMetaAnimationType CMetaAnimRandom::Type() const
|
||||
EMetaAnimType CMetaAnimRandom::Type() const
|
||||
{
|
||||
return eMAT_Random;
|
||||
return EMetaAnimType::Random;
|
||||
}
|
||||
|
||||
void CMetaAnimRandom::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const
|
||||
@@ -132,9 +132,9 @@ CMetaAnimSequence::~CMetaAnimSequence()
|
||||
delete mAnimations[iAnim];
|
||||
}
|
||||
|
||||
EMetaAnimationType CMetaAnimSequence::Type() const
|
||||
EMetaAnimType CMetaAnimSequence::Type() const
|
||||
{
|
||||
return eMAT_Sequence;
|
||||
return EMetaAnimType::Sequence;
|
||||
}
|
||||
|
||||
void CMetaAnimSequence::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#include "Core/Resource/TResPtr.h"
|
||||
#include <Common/TString.h>
|
||||
|
||||
enum EMetaAnimationType
|
||||
enum class EMetaAnimType
|
||||
{
|
||||
eMAT_Play = 0,
|
||||
eMAT_Blend = 1,
|
||||
eMAT_PhaseBlend = 2, // note: structure shared with eMAT_Blend
|
||||
eMAT_Random = 3,
|
||||
eMAT_Sequence = 4
|
||||
Play = 0,
|
||||
Blend = 1,
|
||||
PhaseBlend = 2, // note: structure shared with eMAT_Blend
|
||||
Random = 3,
|
||||
Sequence = 4
|
||||
};
|
||||
|
||||
// Factory class
|
||||
@@ -60,7 +60,7 @@ class IMetaAnimation
|
||||
public:
|
||||
IMetaAnimation() {}
|
||||
virtual ~IMetaAnimation() {}
|
||||
virtual EMetaAnimationType Type() const = 0;
|
||||
virtual EMetaAnimType Type() const = 0;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const = 0;
|
||||
|
||||
// Static
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
public:
|
||||
CMetaAnimPlay(const CAnimPrimitive& rkPrimitive, float UnkA, uint32 UnkB);
|
||||
CMetaAnimPlay(IInputStream& rInput, EGame Game);
|
||||
virtual EMetaAnimationType Type() const;
|
||||
virtual EMetaAnimType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
|
||||
// Accessors
|
||||
@@ -91,16 +91,16 @@ public:
|
||||
class CMetaAnimBlend : public IMetaAnimation
|
||||
{
|
||||
protected:
|
||||
EMetaAnimationType mType;
|
||||
EMetaAnimType mType;
|
||||
IMetaAnimation *mpMetaAnimA;
|
||||
IMetaAnimation *mpMetaAnimB;
|
||||
float mUnknownA;
|
||||
bool mUnknownB;
|
||||
|
||||
public:
|
||||
CMetaAnimBlend(EMetaAnimationType Type, IInputStream& rInput, EGame Game);
|
||||
CMetaAnimBlend(EMetaAnimType Type, IInputStream& rInput, EGame Game);
|
||||
~CMetaAnimBlend();
|
||||
virtual EMetaAnimationType Type() const;
|
||||
virtual EMetaAnimType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
|
||||
// Accessors
|
||||
@@ -126,7 +126,7 @@ protected:
|
||||
public:
|
||||
CMetaAnimRandom(IInputStream& rInput, EGame Game);
|
||||
~CMetaAnimRandom();
|
||||
virtual EMetaAnimationType Type() const;
|
||||
virtual EMetaAnimType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
};
|
||||
|
||||
@@ -139,7 +139,7 @@ protected:
|
||||
public:
|
||||
CMetaAnimSequence(IInputStream& rInput, EGame Game);
|
||||
~CMetaAnimSequence();
|
||||
virtual EMetaAnimationType Type() const;
|
||||
virtual EMetaAnimType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,21 +6,21 @@ CMetaTransFactory gMetaTransFactory;
|
||||
|
||||
IMetaTransition* CMetaTransFactory::LoadFromStream(IInputStream& rInput, EGame Game)
|
||||
{
|
||||
EMetaTransitionType Type = (EMetaTransitionType) rInput.ReadLong();
|
||||
EMetaTransType Type = (EMetaTransType) rInput.ReadLong();
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case eMTT_MetaAnim:
|
||||
case EMetaTransType::MetaAnim:
|
||||
return new CMetaTransMetaAnim(rInput, Game);
|
||||
|
||||
case eMTT_Trans:
|
||||
case eMTT_PhaseTrans:
|
||||
case EMetaTransType::Trans:
|
||||
case EMetaTransType::PhaseTrans:
|
||||
return new CMetaTransTrans(Type, rInput, Game);
|
||||
|
||||
case eMTT_Snap:
|
||||
case EMetaTransType::Snap:
|
||||
return new CMetaTransSnap(rInput, Game);
|
||||
|
||||
case eMTT_Type4:
|
||||
case EMetaTransType::Type4:
|
||||
return new CMetaTransType4(rInput, Game);
|
||||
|
||||
default:
|
||||
@@ -40,9 +40,9 @@ CMetaTransMetaAnim::~CMetaTransMetaAnim()
|
||||
delete mpAnim;
|
||||
}
|
||||
|
||||
EMetaTransitionType CMetaTransMetaAnim::Type() const
|
||||
EMetaTransType CMetaTransMetaAnim::Type() const
|
||||
{
|
||||
return eMTT_MetaAnim;
|
||||
return EMetaTransType::MetaAnim;
|
||||
}
|
||||
|
||||
void CMetaTransMetaAnim::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const
|
||||
@@ -51,9 +51,9 @@ void CMetaTransMetaAnim::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet)
|
||||
}
|
||||
|
||||
// ************ CMetaTransTrans ************
|
||||
CMetaTransTrans::CMetaTransTrans(EMetaTransitionType Type, IInputStream& rInput, EGame Game)
|
||||
CMetaTransTrans::CMetaTransTrans(EMetaTransType Type, IInputStream& rInput, EGame Game)
|
||||
{
|
||||
ASSERT(Type == eMTT_Trans || Type == eMTT_PhaseTrans);
|
||||
ASSERT(Type == EMetaTransType::Trans || Type == EMetaTransType::PhaseTrans);
|
||||
mType = Type;
|
||||
|
||||
if (Game <= EGame::Echoes)
|
||||
@@ -70,7 +70,7 @@ CMetaTransTrans::CMetaTransTrans(EMetaTransitionType Type, IInputStream& rInput,
|
||||
}
|
||||
}
|
||||
|
||||
EMetaTransitionType CMetaTransTrans::Type() const
|
||||
EMetaTransType CMetaTransTrans::Type() const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
@@ -84,9 +84,9 @@ CMetaTransSnap::CMetaTransSnap(IInputStream&, EGame)
|
||||
{
|
||||
}
|
||||
|
||||
EMetaTransitionType CMetaTransSnap::Type() const
|
||||
EMetaTransType CMetaTransSnap::Type() const
|
||||
{
|
||||
return eMTT_Snap;
|
||||
return EMetaTransType::Snap;
|
||||
}
|
||||
|
||||
void CMetaTransSnap::GetUniquePrimitives(std::set<CAnimPrimitive>&) const
|
||||
@@ -99,9 +99,9 @@ CMetaTransType4::CMetaTransType4(IInputStream& rInput, EGame)
|
||||
rInput.Skip(0x14);
|
||||
}
|
||||
|
||||
EMetaTransitionType CMetaTransType4::Type() const
|
||||
EMetaTransType CMetaTransType4::Type() const
|
||||
{
|
||||
return eMTT_Type4;
|
||||
return EMetaTransType::Type4;
|
||||
}
|
||||
|
||||
void CMetaTransType4::GetUniquePrimitives(std::set<CAnimPrimitive>&) const
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
class IMetaAnimation;
|
||||
class IMetaTransition;
|
||||
|
||||
enum EMetaTransitionType
|
||||
enum class EMetaTransType
|
||||
{
|
||||
eMTT_MetaAnim = 0,
|
||||
eMTT_Trans = 1,
|
||||
eMTT_PhaseTrans = 2, // note: structure shared with eMTT_Trans
|
||||
eMTT_Snap = 3,
|
||||
eMTT_Type4 = 4 // MP3 only
|
||||
MetaAnim = 0,
|
||||
Trans = 1,
|
||||
PhaseTrans = 2, // note: structure shared with eMTT_Trans
|
||||
Snap = 3,
|
||||
Type4 = 4 // MP3 only
|
||||
};
|
||||
|
||||
// Factory class
|
||||
@@ -29,7 +29,7 @@ class IMetaTransition
|
||||
public:
|
||||
IMetaTransition() {}
|
||||
virtual ~IMetaTransition() {}
|
||||
virtual EMetaTransitionType Type() const = 0;
|
||||
virtual EMetaTransType Type() const = 0;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const = 0;
|
||||
};
|
||||
|
||||
@@ -41,14 +41,14 @@ class CMetaTransMetaAnim : public IMetaTransition
|
||||
public:
|
||||
CMetaTransMetaAnim(IInputStream& rInput, EGame Game);
|
||||
~CMetaTransMetaAnim();
|
||||
virtual EMetaTransitionType Type() const;
|
||||
virtual EMetaTransType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
};
|
||||
|
||||
// CMetaTransTrans
|
||||
class CMetaTransTrans : public IMetaTransition
|
||||
{
|
||||
EMetaTransitionType mType;
|
||||
EMetaTransType mType;
|
||||
float mUnknownA;
|
||||
uint32 mUnknownB;
|
||||
bool mUnknownC;
|
||||
@@ -56,8 +56,8 @@ class CMetaTransTrans : public IMetaTransition
|
||||
uint32 mUnknownE;
|
||||
|
||||
public:
|
||||
CMetaTransTrans(EMetaTransitionType Type, IInputStream& rInput, EGame Game);
|
||||
virtual EMetaTransitionType Type() const;
|
||||
CMetaTransTrans(EMetaTransType Type, IInputStream& rInput, EGame Game);
|
||||
virtual EMetaTransType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ class CMetaTransSnap : public IMetaTransition
|
||||
{
|
||||
public:
|
||||
CMetaTransSnap(IInputStream& rInput, EGame Game);
|
||||
virtual EMetaTransitionType Type() const;
|
||||
virtual EMetaTransType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ class CMetaTransType4 : public IMetaTransition
|
||||
{
|
||||
public:
|
||||
CMetaTransType4(IInputStream& rInput, EGame Game);
|
||||
virtual EMetaTransitionType Type() const;
|
||||
virtual EMetaTransType Type() const;
|
||||
virtual void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user