mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 15:44:56 +00:00
ANIM serialization fix
This commit is contained in:
@@ -459,7 +459,6 @@ void ANIM::ANIM2::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer)
|
||||
head.binarySize(scratchSize);
|
||||
keyBmp.binarySize(scratchSize);
|
||||
scratchSize += bsSize;
|
||||
head.scratchSize = scratchSize;
|
||||
if (m_version == 3)
|
||||
{
|
||||
for (const std::pair<atUint32, bool>& bone : bones)
|
||||
@@ -468,7 +467,7 @@ void ANIM::ANIM2::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer)
|
||||
desc.keyCount1 = keyframeCount;
|
||||
if (bone.second)
|
||||
desc.keyCount2 = keyframeCount;
|
||||
head.scratchSize = desc.binarySize(head.scratchSize);
|
||||
desc.binarySize(scratchSize);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -479,9 +478,10 @@ void ANIM::ANIM2::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer)
|
||||
desc.keyCount1 = keyframeCount;
|
||||
if (bone.second)
|
||||
desc.keyCount2 = keyframeCount;
|
||||
head.scratchSize = desc.binarySize(head.scratchSize);
|
||||
desc.binarySize(scratchSize);
|
||||
}
|
||||
}
|
||||
head.scratchSize = scratchSize;
|
||||
|
||||
head.write(writer);
|
||||
keyBmp.write(writer);
|
||||
|
||||
@@ -133,12 +133,11 @@ struct ANIM : BigDNA
|
||||
writer.writeUByte(qTZ);
|
||||
}
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
void binarySize(size_t& __isz) const
|
||||
{
|
||||
__isz += 17;
|
||||
if (keyCount2)
|
||||
__isz += 9;
|
||||
return __isz;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -185,12 +184,11 @@ struct ANIM : BigDNA
|
||||
writer.writeUint32Big(QinitTZ);
|
||||
}
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
void binarySize(size_t& __isz) const
|
||||
{
|
||||
__isz += 24;
|
||||
if (keyCount2)
|
||||
__isz += 12;
|
||||
return __isz;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user