diff --git a/libs/xassets/xsurface.cpp b/libs/xassets/xsurface.cpp index 2da17e7..cd4d2a0 100644 --- a/libs/xassets/xsurface.cpp +++ b/libs/xassets/xsurface.cpp @@ -8,8 +8,8 @@ XSurface::XSurface() , mTriCount(0) , mTriIndices(0) , mVertInfo() - , mVerts0(new XGfxPackedVertex()) - , mVb0() + , mVert() + , mVertBuffer() , mVertListCount(0) , mVertList() , mIndexBuffer() @@ -18,9 +18,46 @@ XSurface::XSurface() } +XSurface::~XSurface() +{ + +} + void XSurface::ParseData(QDataStream *aStream) { - + *aStream + >> mTileMode + >> mDeformed + >> mVertCount + >> mTriCount; + + aStream->skipRawData(2); + + qint32 triIndicesPtr; + *aStream + >> triIndicesPtr; + + mVertInfo.ParsePtr(aStream, false); + mVert.ParsePtr(aStream, false); + + qint32 vertBuffersPtr, vertListPtr; + *aStream + >> vertBuffersPtr + >> mVertListCount + >> vertListPtr; + + mIndexBuffer.ParseData(aStream); + + *aStream + >> mPartBits[0] + >> mPartBits[1] + >> mPartBits[2] + >> mPartBits[3]; + + mVertInfo.ParseData(aStream); + mVert.ParseData(aStream); + + // TODO: Fill out the rest of this } void XSurface::Clear() diff --git a/libs/xassets/xsurface.h b/libs/xassets/xsurface.h index 8a82583..7250ecd 100644 --- a/libs/xassets/xsurface.h +++ b/libs/xassets/xsurface.h @@ -12,6 +12,7 @@ class XSurface : public XAsset { public: explicit XSurface(); + ~XSurface(); void ParseData(QDataStream *aStream) override; void Clear() override; @@ -21,14 +22,14 @@ private: bool mDeformed; quint32 mVertCount; quint32 mTriCount; - quint32 *mTriIndices; + QVector mTriIndices; XSurfaceVertexInfo mVertInfo; - XGfxPackedVertex *mVerts0; - XD3DVertexBuffer mVb0; + XGfxPackedVertex mVert; + XD3DVertexBuffer mVertBuffer; quint32 mVertListCount; QVector mVertList; XD3DIndexBuffer mIndexBuffer; - int mPartBits[4]; + QVector mPartBits; }; #endif // XSURFACE_H