From a85abf0ecdd942f9ba61e16325194aca826982ea Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Wed, 3 Sep 2025 13:00:58 -0400 Subject: [PATCH] Update asset and animation structure definitions --- libs/xassets/xanimparttrans.h | 7 +----- libs/xassets/xanimparttransdata.h | 6 +---- libs/xassets/xasset.h | 3 +-- libs/xassets/xassetlist.cpp | 37 ++++++++++++++++--------------- libs/xassets/xassetlist.h | 18 +++++++-------- 5 files changed, 30 insertions(+), 41 deletions(-) diff --git a/libs/xassets/xanimparttrans.h b/libs/xassets/xanimparttrans.h index 659b97b..433f47f 100644 --- a/libs/xassets/xanimparttrans.h +++ b/libs/xassets/xanimparttrans.h @@ -1,9 +1,3 @@ - - - - - - #ifndef XANIMPARTTRANS_H #define XANIMPARTTRANS_H @@ -14,6 +8,7 @@ class XAnimPartTrans : public XAsset { public: explicit XAnimPartTrans(); + ~XAnimPartTrans(); void ParseData(QDataStream *aStream) override; diff --git a/libs/xassets/xanimparttransdata.h b/libs/xassets/xanimparttransdata.h index 063c99a..9d70d16 100644 --- a/libs/xassets/xanimparttransdata.h +++ b/libs/xassets/xanimparttransdata.h @@ -1,8 +1,3 @@ - - - - - #ifndef XANIMPARTTRANSDATA_H #define XANIMPARTTRANSDATA_H @@ -13,6 +8,7 @@ class XAnimPartTransData : public XAsset { public: explicit XAnimPartTransData(); + ~XAnimPartTransData(); void ParseData(QDataStream *aStream) override; diff --git a/libs/xassets/xasset.h b/libs/xassets/xasset.h index 7e2c550..e3ada07 100644 --- a/libs/xassets/xasset.h +++ b/libs/xassets/xasset.h @@ -1,11 +1,10 @@ #ifndef XASSET_H #define XASSET_H -#include +#include class XAsset { - public: XAsset(); virtual ~XAsset(); diff --git a/libs/xassets/xassetlist.cpp b/libs/xassets/xassetlist.cpp index 8314e69..9d1d8a6 100644 --- a/libs/xassets/xassetlist.cpp +++ b/libs/xassets/xassetlist.cpp @@ -1,32 +1,37 @@ - - - #include "xassetlist.h" XAssetList::XAssetList() - : XAsset() { + : XAsset() + , mStringList() + , mAssetCount(0) + , mAssets() +{ } void XAssetList::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { // Parse string list - mStringList.ParseData(aStream); + mStringList.ParsePtr(aStream); // Parse asset count and assets - aStream->read((char*)&mAssetCount, sizeof(int)); - for (int i = 0; i < mAssetCount; ++i) { - XAsset asset; - asset.ParseData(aStream); - mAssets.append(asset); + *aStream >> mAssetCount; + aStream->skipRawData(2 * 4); + + mStringList.ParseData(aStream); + + for (int i = 0; i < mAssetCount; i++) { + //XAsset asset; + //asset.ParseData(aStream); + //mAssets.append(asset); } } } -const ScriptStringList& XAssetList::GetStringList() const { +XScriptStringList XAssetList::GetStringList() const { return mStringList; } -void XAssetList::SetStringList(const ScriptStringList& stringList) { +void XAssetList::SetStringList(const XScriptStringList& stringList) { mStringList = stringList; } @@ -38,15 +43,11 @@ void XAssetList::SetAssetCount(int count) { mAssetCount = count; } -QVector& XAssetList::GetAssets() { +QVector XAssetList::GetAssets() { return mAssets; } -const QVector& XAssetList::GetAssets() const { - return mAssets; -} - -void XAssetList::SetAssets(const QVector& assets) { +void XAssetList::SetAssets(QVector assets) { mAssets = assets; } diff --git a/libs/xassets/xassetlist.h b/libs/xassets/xassetlist.h index 50cafaf..9f3caa1 100644 --- a/libs/xassets/xassetlist.h +++ b/libs/xassets/xassetlist.h @@ -1,11 +1,10 @@ - - #ifndef XASSETLIST_H #define XASSETLIST_H +#include "xscriptstringlist.h" #include "xasset.h" + #include -#include "scriptstringlist.h" class XAssetList : public XAsset { @@ -14,20 +13,19 @@ public: void ParseData(QDataStream *aStream) override; - const ScriptStringList& GetStringList() const; - void SetStringList(const ScriptStringList& stringList); + XScriptStringList GetStringList() const; + void SetStringList(const XScriptStringList& stringList); int GetAssetCount() const; void SetAssetCount(int count); - QVector& GetAssets(); - const QVector& GetAssets() const; - void SetAssets(const QVector& assets); + QVector GetAssets(); + void SetAssets(QVector assets); private: - ScriptStringList mStringList; + XScriptStringList mStringList; int mAssetCount = 0; - QVector mAssets; + QVector mAssets; }; #endif // XASSETLIST_H