XPlor/libs/xassets/xsurfacevertexinfo.cpp

64 lines
1.7 KiB
C++
Raw Permalink Normal View History

2025-09-03 13:28:03 -04:00
#include "xsurfacevertexinfo.h"
XSurfaceVertexInfo::XSurfaceVertexInfo()
: XAsset()
2025-09-07 23:16:14 -04:00
, mVertCount(4)
2025-09-03 13:28:03 -04:00
, mVertsBlend()
{
2025-09-10 21:58:26 -04:00
SetName("Surface Vertex Info");
2025-09-03 13:28:03 -04:00
}
2025-09-10 21:58:26 -04:00
void XSurfaceVertexInfo::ParseData(XDataStream *aStream)
2025-09-03 13:28:03 -04:00
{
2025-09-07 23:16:14 -04:00
if (GetPtr() == -1)
{
2025-09-10 21:58:26 -04:00
*aStream >> mVertCount[0];
if (IsDebug())
{
qDebug() << QString("[%1] mVertCount[0] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mVertCount[0]);
}
*aStream >> mVertCount[1];
if (IsDebug())
{
qDebug() << QString("[%1] mVertCount[1] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mVertCount[1]);
}
*aStream >> mVertCount[2];
if (IsDebug())
{
qDebug() << QString("[%1] mVertCount[2] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mVertCount[2]);
}
*aStream >> mVertCount[3];
if (IsDebug())
{
qDebug() << QString("[%1] mVertCount[3] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mVertCount[3]);
}
qint32 vertsBlendPtr;
*aStream >> vertsBlendPtr;
if (IsDebug())
{
qDebug() << QString("[%1] vertsBlendPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(vertsBlendPtr);
}
if (vertsBlendPtr == -1)
2025-09-07 23:16:14 -04:00
{
aStream->readRawData(mVertsBlend.data(), 2 * (mVertCount[0] + 3 * mVertCount[1] + 5 * mVertCount[2] + 7 * mVertCount[3]));
2025-09-10 21:58:26 -04:00
if (IsDebug())
{
qDebug() << QString("[%1] mVertsBlend = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mVertsBlend);
}
2025-09-07 23:16:14 -04:00
}
}
2025-09-03 13:28:03 -04:00
}
void XSurfaceVertexInfo::Clear()
{
}