2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 21:07:42 +00:00

Signed read bug fix

This commit is contained in:
Jack Andersen
2016-08-28 16:28:55 -10:00
parent 7953ca4828
commit e2f342d107
3 changed files with 26 additions and 24 deletions

View File

@@ -77,38 +77,38 @@ struct ANIM : BigDNA
Delete expl;
Value<atUint32> id = 0;
Value<atUint16> keyCount1 = 0;
Value<atUint16> initRX = 0;
Value<atInt16> initRX = 0;
Value<atUint8> qRX = 0;
Value<atUint16> initRY = 0;
Value<atInt16> initRY = 0;
Value<atUint8> qRY = 0;
Value<atUint16> initRZ = 0;
Value<atInt16> initRZ = 0;
Value<atUint8> qRZ = 0;
Value<atUint16> keyCount2 = 0;
Value<atUint16> initTX = 0;
Value<atInt16> initTX = 0;
Value<atUint8> qTX = 0;
Value<atUint16> initTY = 0;
Value<atInt16> initTY = 0;
Value<atUint8> qTY = 0;
Value<atUint16> initTZ = 0;
Value<atInt16> initTZ = 0;
Value<atUint8> qTZ = 0;
void read(athena::io::IStreamReader& reader)
{
id = reader.readUint32Big();
keyCount1 = reader.readUint16Big();
initRX = reader.readUint16Big();
initRX = reader.readInt16Big();
qRX = reader.readUByte();
initRY = reader.readUint16Big();
initRY = reader.readInt16Big();
qRY = reader.readUByte();
initRZ = reader.readUint16Big();
initRZ = reader.readInt16Big();
qRZ = reader.readUByte();
keyCount2 = reader.readUint16Big();
if (keyCount2)
{
initTX = reader.readUint16Big();
initTX = reader.readInt16Big();
qTX = reader.readUByte();
initTY = reader.readUint16Big();
initTY = reader.readInt16Big();
qTY = reader.readUByte();
initTZ = reader.readUint16Big();
initTZ = reader.readInt16Big();
qTZ = reader.readUByte();
}
}
@@ -116,20 +116,20 @@ struct ANIM : BigDNA
{
writer.writeUint32Big(id);
writer.writeUint16Big(keyCount1);
writer.writeUint16Big(initRX);
writer.writeInt16Big(initRX);
writer.writeUByte(qRX);
writer.writeUint16Big(initRY);
writer.writeInt16Big(initRY);
writer.writeUByte(qRY);
writer.writeUint16Big(initRZ);
writer.writeInt16Big(initRZ);
writer.writeUByte(qRZ);
writer.writeUint16Big(keyCount2);
if (keyCount2)
{
writer.writeUint16Big(initTX);
writer.writeInt16Big(initTX);
writer.writeUByte(qTX);
writer.writeUint16Big(initTY);
writer.writeInt16Big(initTY);
writer.writeUByte(qTY);
writer.writeUint16Big(initTZ);
writer.writeInt16Big(initTZ);
writer.writeUByte(qTZ);
}
}