From d525f9bee3cd57e708f2a704aacb2678c3768aec Mon Sep 17 00:00:00 2001 From: njohnson Date: Sun, 7 Sep 2025 23:12:04 -0400 Subject: [PATCH] Update XGfxWorldVertexData parsing logic --- libs/xassets/xgfxworldvertexdata.cpp | 59 +++++++++------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/libs/xassets/xgfxworldvertexdata.cpp b/libs/xassets/xgfxworldvertexdata.cpp index 270e93c..fa6e37c 100644 --- a/libs/xassets/xgfxworldvertexdata.cpp +++ b/libs/xassets/xgfxworldvertexdata.cpp @@ -1,51 +1,30 @@ #include "xgfxworldvertexdata.h" XGfxWorldVertexData::XGfxWorldVertexData() - : XAsset() { + : XAsset() + , mVertices() + , mWorldVertexBuffer() +{ + +} + +XGfxWorldVertexData::~XGfxWorldVertexData() +{ + +} + +void XGfxWorldVertexData::Clear() +{ + mVertices.clear(); + mWorldVertexBuffer.Clear(); } void XGfxWorldVertexData::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - // Parse vertex count - int vertexCount; - *aStream >> vertexCount; - // Clear existing data before parsing new data - mVertices.clear(); + qint32 worldVertexPtr; + *aStream >> worldVertexPtr; - // Parse vertices - for (int i = 0; i < vertexCount; ++i) { - XGfxWorldVertex vertex; - vertex.ParseData(aStream); - mVertices.append(vertex); - } - - // Skip D3DVertexBuffer pointer - we'll handle this appropriately later - qint32 bufferPtr; - *aStream >> bufferPtr; - if (bufferPtr == -1) - { - - } + mWorldVertexBuffer.ParseData(aStream); } } - -QVector& XGfxWorldVertexData::GetVertices() { - return mVertices; -} - -const QVector& XGfxWorldVertexData::GetVertices() const { - return mVertices; -} - -void XGfxWorldVertexData::SetVertices(const QVector& vertices) { - mVertices = vertices; -} - -int XGfxWorldVertexData::GetVertexBufferPtr() const { - return mVertexBufferPtr; -} - -void XGfxWorldVertexData::SetVertexBufferPtr(int ptr) { - mVertexBufferPtr = ptr; -}