XPlor/libs/xassets/xanimindices.cpp
njohnson 86885f999c Fix: Parse Animation Indices data correctly
This commit fixes the parsing of `XAnimIndices` data, ensuring that the index is correctly parsed from the data stream, including handling the case where the index pointer is -1.
2025-09-10 21:55:54 -04:00

32 lines
606 B
C++

#include "xanimindices.h"
XAnimIndices::XAnimIndices()
: XAsset()
, mIndex(0)
{
SetName("Animation Indices");
}
void XAnimIndices::ParseData(XDataStream *aStream) {
if (GetPtr() == -1) {
qint32 indexPtr = aStream->ParseInt32(QString("%1 index ptr").arg(GetName()));
if (indexPtr == -1)
{
mIndex = aStream->ParseUInt32(QString("%1 index").arg(GetName()));
}
}
}
void XAnimIndices::Clear()
{
mIndex = 0;
}
quint32 XAnimIndices::GetIndex() const {
return mIndex;
}
void XAnimIndices::SetIndex(quint32 index) {
mIndex = index;
}