Fix: Parse frames from data stream
The frames were parsed incorrectly from the data stream. This commit fixes the parsing logic to properly read the frame data using `ParseUInt8` and includes a descriptive name for the asset.
This commit is contained in:
parent
25728f9486
commit
7b61cff46d
@ -4,24 +4,17 @@ XAnimDynamicFrames::XAnimDynamicFrames()
|
||||
: XAsset()
|
||||
, mFrames(3)
|
||||
{
|
||||
SetName("Animation Dynamic Frames");
|
||||
}
|
||||
|
||||
XAnimDynamicFrames::~XAnimDynamicFrames()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void XAnimDynamicFrames::ParseData(QDataStream *aStream) {
|
||||
void XAnimDynamicFrames::ParseData(XDataStream *aStream) {
|
||||
if (GetPtr() == -1) {
|
||||
qint32 framePtr;
|
||||
*aStream >> framePtr;
|
||||
|
||||
qint32 framePtr = aStream->ParseInt32(QString("%1 frames ptr").arg(GetName()));
|
||||
if (framePtr == -1)
|
||||
{
|
||||
*aStream
|
||||
>> mFrames[0]
|
||||
>> mFrames[1]
|
||||
>> mFrames[2];
|
||||
mFrames[0] = aStream->ParseUInt8(QString("%1 frame %2").arg(GetName()).arg(0));
|
||||
mFrames[1] = aStream->ParseUInt8(QString("%1 frame %2").arg(GetName()).arg(1));
|
||||
mFrames[2] = aStream->ParseUInt8(QString("%1 frame %2").arg(GetName()).arg(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user