mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-18 01:15:26 +00:00
Major refactor of serialization system
This commit is contained in:
@@ -15,6 +15,7 @@ CAnimationParameters::CAnimationParameters()
|
||||
|
||||
CAnimationParameters::CAnimationParameters(EGame Game)
|
||||
: mGame(Game)
|
||||
, mCharacterID( CAssetID::InvalidID(Game) )
|
||||
, mCharIndex(0)
|
||||
, mAnimIndex(0)
|
||||
, mUnknown2(0)
|
||||
@@ -141,17 +142,17 @@ void CAnimationParameters::Serialize(IArchive& rArc)
|
||||
if (rArc.IsReader())
|
||||
mGame = rArc.Game();
|
||||
|
||||
rArc << SERIAL("AnimationSetAsset", mCharacterID);
|
||||
rArc << SerialParameter("AnimationSetAsset", mCharacterID);
|
||||
|
||||
if (mGame <= eEchoes)
|
||||
rArc << SERIAL("CharacterID", mCharIndex);
|
||||
rArc << SerialParameter("CharacterID", mCharIndex);
|
||||
|
||||
rArc << SERIAL("AnimationID", mAnimIndex);
|
||||
rArc << SerialParameter("AnimationID", mAnimIndex);
|
||||
|
||||
if (mGame >= eReturns)
|
||||
{
|
||||
rArc << SERIAL("Unknown0", mUnknown2)
|
||||
<< SERIAL("Unknown1", mUnknown3);
|
||||
rArc << SerialParameter("Unknown0", mUnknown2)
|
||||
<< SerialParameter("Unknown1", mUnknown3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,11 +35,36 @@ public:
|
||||
inline void SetCharIndex(u32 Index) { mCharIndex = Index; }
|
||||
inline void SetAnimIndex(u32 Index) { mAnimIndex = Index; }
|
||||
|
||||
inline void SetGame(EGame Game)
|
||||
{
|
||||
mGame = Game;
|
||||
|
||||
if (!mCharacterID.IsValid())
|
||||
{
|
||||
mCharacterID = CAssetID::InvalidID(mGame);
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT( mCharacterID.Length() == CAssetID::GameIDLength(mGame) );
|
||||
}
|
||||
}
|
||||
|
||||
u32 Unknown(u32 Index);
|
||||
void SetResource(const CAssetID& rkID);
|
||||
void SetUnknown(u32 Index, u32 Value);
|
||||
|
||||
// Operators
|
||||
inline CAnimationParameters& operator=(const CAnimationParameters& rkOther)
|
||||
{
|
||||
mGame = rkOther.mGame;
|
||||
mCharacterID = rkOther.mCharacterID;
|
||||
mCharIndex = rkOther.mCharIndex;
|
||||
mAnimIndex = rkOther.mAnimIndex;
|
||||
mUnknown2 = rkOther.mUnknown2;
|
||||
mUnknown3 = rkOther.mUnknown3;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator==(const CAnimationParameters& rkOther) const
|
||||
{
|
||||
return ( (mGame == rkOther.mGame) &&
|
||||
|
||||
Reference in New Issue
Block a user