diff --git a/libs/xassets/xgfxcell.cpp b/libs/xassets/xgfxcell.cpp index 5a5c427..ea54369 100644 --- a/libs/xassets/xgfxcell.cpp +++ b/libs/xassets/xgfxcell.cpp @@ -23,7 +23,62 @@ XGfxCell::~XGfxCell() void XGfxCell::ParseData(QDataStream *aStream) { + qint32 aabbTreePtr, portalsPtr, cullGroupsPtr, reflectionProbesPtr; + *aStream + >> mMins[0] + >> mMins[1] + >> mMins[2] + >> mMaxs[0] + >> mMaxs[1] + >> mMaxs[2] + >> mAabbTreeCount + >> aabbTreePtr + >> mPortalCount + >> portalsPtr + >> mCullGroupCount + >> cullGroupsPtr + >> mReflectionProbeCount + >> reflectionProbesPtr; + if (aabbTreePtr) + { + for (int i = 0; i < mAabbTreeCount; i++) + { + XGfxAabbTree newTree; + newTree.ParseData(aStream); + mAabbTree.append(newTree); + } + } + + if (portalsPtr) + { + for (int i = 0; i < mPortalCount; i++) + { + XGfxPortal newPortal; + newPortal.ParseData(aStream); + mPortals.append(newPortal); + } + } + + if (cullGroupsPtr) + { + for (int i = 0; i < mCullGroupCount; i++) + { + qint32 newCullGroup; + *aStream >> newCullGroup; + mCullGroups.append(newCullGroup); + } + } + + if (reflectionProbesPtr) + { + for (int i = 0; i < mReflectionProbeCount; i++) + { + quint8 newReflectionProbe; + *aStream >> newReflectionProbe; + mReflectionProbes.append(newReflectionProbe); + } + } } void XGfxCell::Clear() diff --git a/libs/xassets/xgfxcell.h b/libs/xassets/xgfxcell.h index 8d1cefc..40d7b42 100644 --- a/libs/xassets/xgfxcell.h +++ b/libs/xassets/xgfxcell.h @@ -28,7 +28,7 @@ private: QVector mPortals; int mCullGroupCount; - QVector mCullGroups; + QVector mCullGroups; quint8 mReflectionProbeCount; QVector mReflectionProbes;