XPlor/libs/xassets/xgfxworldstreaminfo.cpp

49 lines
1.0 KiB
C++
Raw Permalink Normal View History

2025-08-17 13:14:17 -04:00
#include "xgfxworldstreaminfo.h"
XGfxWorldStreamInfo::XGfxWorldStreamInfo()
2025-09-05 18:35:17 -04:00
: XAsset()
, mAabbTreeCount(0)
, mAabbTrees()
, mLeafRefCount(0)
, mLeafRefs()
{
2025-09-10 21:58:26 -04:00
SetName("GFX World Stream Info");
2025-09-05 18:35:17 -04:00
}
XGfxWorldStreamInfo::~XGfxWorldStreamInfo()
{
2025-08-17 13:14:17 -04:00
}
2025-09-10 21:58:26 -04:00
void XGfxWorldStreamInfo::ParseData(XDataStream *aStream) {
2025-08-17 13:14:17 -04:00
if (GetPtr() == -1) {
2025-09-05 18:35:17 -04:00
*aStream >> mAabbTreeCount;
2025-08-17 13:14:17 -04:00
// Clear existing data before parsing new data
mAabbTrees.clear();
// Parse AABB trees
for (int i = 0; i < mAabbTreeCount; ++i) {
XGfxStreamingAabbTree tree;
tree.ParseData(aStream);
mAabbTrees.append(tree);
}
// Parse leaf ref count and array
2025-09-05 18:35:17 -04:00
*aStream >> mLeafRefCount;
2025-08-17 13:14:17 -04:00
if (mLeafRefCount > 0) {
2025-09-05 18:35:17 -04:00
int leafRef;
*aStream >> leafRef;
mLeafRefs.append(leafRef);
2025-08-17 13:14:17 -04:00
}
}
}
2025-09-05 18:35:17 -04:00
void XGfxWorldStreamInfo::Clear()
{
mAabbTreeCount = 0;
mAabbTrees = QVector<XGfxStreamingAabbTree>();
mLeafRefCount = 0;
mLeafRefs = QVector<int>();
2025-08-17 13:14:17 -04:00
}