XPlor/libs/xassets/xgfxworld.cpp

59 lines
1.2 KiB
C++
Raw Normal View History

2025-08-17 13:14:17 -04:00
#include "xgfxworld.h"
2025-09-05 18:35:17 -04:00
#include "xstring.h"
2025-08-17 13:14:17 -04:00
XGfxWorld::XGfxWorld()
2025-09-05 18:35:17 -04:00
: XAsset()
, mName("")
, mStreamingInfo()
, mVertexData()
, mSunLightParams()
, mLights()
, mReflectionProbes()
{
SetType(ASSET_TYPE_GFXWORLD);
SetName("GFXWorld");
}
XGfxWorld::~XGfxWorld()
{
2025-08-17 13:14:17 -04:00
}
void XGfxWorld::ParseData(QDataStream *aStream) {
if (GetPtr() == -1) {
2025-09-05 18:35:17 -04:00
mName = XString::ParseCustom(aStream);
2025-08-17 13:14:17 -04:00
// Parse streaming info
mStreamingInfo.ParseData(aStream);
// Parse vertex data
mVertexData.ParseData(aStream);
// Parse sun light params
mSunLightParams.ParseData(aStream);
// Parse lights count and array
int lightCount;
2025-09-05 18:35:17 -04:00
*aStream >> lightCount;
2025-08-17 13:14:17 -04:00
for (int i = 0; i < lightCount; ++i) {
XGfxLight light;
light.ParseData(aStream);
mLights.append(light);
}
// Parse reflection probes count and array
int probeCount;
2025-09-05 18:35:17 -04:00
*aStream >> probeCount;
2025-08-17 13:14:17 -04:00
for (int i = 0; i < probeCount; ++i) {
XGfxReflectionProbe probe;
probe.ParseData(aStream);
mReflectionProbes.append(probe);
}
}
}
2025-09-05 18:35:17 -04:00
void XGfxWorld::Clear()
{
2025-08-17 13:14:17 -04:00
}