summaryrefslogtreecommitdiff
path: root/ZAPD/ZFile.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-03-17 19:19:16 -0300
committerGitHub <noreply@github.com>2021-03-17 18:19:16 -0400
commitd698b97d02380b3bf2c898de44941d03e37daff4 (patch)
tree86a6928ad6d012cbf16c4839bd47312a7c1d207b /ZAPD/ZFile.cpp
parentb25eb9a568b4dd0dbc5c2fea3d9e85ca69e21aa2 (diff)
Add new resource ZSymbol (#92)
* ZSymbol Signed-off-by: Angie <angheloalf95@gmail.com> * Add array support to ZSymbol Signed-off-by: Angie <angheloalf95@gmail.com> * Export symbol as array Signed-off-by: Angie <angheloalf95@gmail.com> * Final cleanup Signed-off-by: Angie <angheloalf95@gmail.com> * Ups, forgot the offset in a constructor Signed-off-by: Angie <angheloalf95@gmail.com>
Diffstat (limited to 'ZAPD/ZFile.cpp')
-rw-r--r--ZAPD/ZFile.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp
index 5046ed1..77b99ea 100644
--- a/ZAPD/ZFile.cpp
+++ b/ZAPD/ZFile.cpp
@@ -12,6 +12,7 @@
#include "ZVtx.h"
#include "ZCutscene.h"
#include "ZArray.h"
+#include "ZSymbol.h"
#include "Path.h"
#include "File.h"
#include "Directory.h"
@@ -249,17 +250,15 @@ void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, std::string filename, b
}
else if (string(child->Name()) == "Symbol")
{
- ZResource* res = nullptr;
+ ZSymbol* symbol = nullptr;
- if (mode == ZFileMode::Extract)
- {
- res = new ZResource();
- res->SetName(child->Attribute("Name"));
- res->SetRawDataIndex(rawDataIndex);
- res->outputDeclaration = false;
+ if (mode == ZFileMode::Extract) {
+ symbol = ZSymbol::ExtractFromXML(child, rawData, rawDataIndex, this);
}
- resources.push_back(res);
+ if (symbol != nullptr) {
+ resources.push_back(symbol);
+ }
}
else if (string(child->Name()) == "Collision")
{