Updated xsurface

This commit is contained in:
njohnson 2025-09-07 23:16:14 -04:00
parent 53f690c554
commit 6e73c2d50c
2 changed files with 45 additions and 7 deletions

View File

@ -8,8 +8,8 @@ XSurface::XSurface()
, mTriCount(0) , mTriCount(0)
, mTriIndices(0) , mTriIndices(0)
, mVertInfo() , mVertInfo()
, mVerts0(new XGfxPackedVertex()) , mVert()
, mVb0() , mVertBuffer()
, mVertListCount(0) , mVertListCount(0)
, mVertList() , mVertList()
, mIndexBuffer() , mIndexBuffer()
@ -18,9 +18,46 @@ XSurface::XSurface()
} }
XSurface::~XSurface()
{
}
void XSurface::ParseData(QDataStream *aStream) 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() void XSurface::Clear()

View File

@ -12,6 +12,7 @@ class XSurface : public XAsset
{ {
public: public:
explicit XSurface(); explicit XSurface();
~XSurface();
void ParseData(QDataStream *aStream) override; void ParseData(QDataStream *aStream) override;
void Clear() override; void Clear() override;
@ -21,14 +22,14 @@ private:
bool mDeformed; bool mDeformed;
quint32 mVertCount; quint32 mVertCount;
quint32 mTriCount; quint32 mTriCount;
quint32 *mTriIndices; QVector<quint32> mTriIndices;
XSurfaceVertexInfo mVertInfo; XSurfaceVertexInfo mVertInfo;
XGfxPackedVertex *mVerts0; XGfxPackedVertex mVert;
XD3DVertexBuffer mVb0; XD3DVertexBuffer mVertBuffer;
quint32 mVertListCount; quint32 mVertListCount;
QVector<XRigidVertList> mVertList; QVector<XRigidVertList> mVertList;
XD3DIndexBuffer mIndexBuffer; XD3DIndexBuffer mIndexBuffer;
int mPartBits[4]; QVector<int> mPartBits;
}; };
#endif // XSURFACE_H #endif // XSURFACE_H