summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Bird <Archez@users.noreply.github.com>2023-11-05 12:24:02 -0500
committerGitHub <noreply@github.com>2023-11-05 12:24:02 -0500
commit0d8f5570a8e57f302ec6633d65615ee21ab39454 (patch)
treee2c54e2868d231b63a190a5e570098607d82b10d
parentcde9a3b655570370e4ed4928e8c9f3a0f631c52e (diff)
Place shared scenes in their own location (#11)
* separate shared scene exports from dungeons * use regex for only main dungeons
-rw-r--r--OTRExporter/DisplayListExporter.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/OTRExporter/DisplayListExporter.cpp b/OTRExporter/DisplayListExporter.cpp
index 81863f0..77697dd 100644
--- a/OTRExporter/DisplayListExporter.cpp
+++ b/OTRExporter/DisplayListExporter.cpp
@@ -8,6 +8,7 @@
#include <libultraship/libultra/gbi.h>
#include <Globals.h>
#include <iostream>
+#include <regex>
#include <string>
#include "MtxExporter.h"
#include <Utils/DiskFile.h>
@@ -883,13 +884,19 @@ std::string OTRExporter_DisplayList::GetPrefix(ZResource* res)
std::string xmlPath = StringHelper::Replace(res->parent->GetXmlFilePath().string(), "\\", "/");
if (StringHelper::Contains(oName, "_scene") || StringHelper::Contains(oName, "_room")) {
- prefix = "scenes";
- if (Globals::Instance->rom->IsMQ()) {
- prefix += "/mq";
- } else {
- prefix += "/nonmq";
- }
- }
+ prefix = "scenes/shared";
+
+ // Regex for xml paths that are dungeons with unique MQ variants (only the main dungeon, not boss rooms)
+ std::regex dungeonsWithMQ(R"(((ydan)|(ddan)|(bdan)|(Bmori1)|(HIDAN)|(MIZUsin)|(jyasinzou)|(HAKAdan)|(HAKAdanCH)|(ice_doukutu)|(men)|(ganontika))\.xml)");
+
+ if (StringHelper::Contains(xmlPath, "dungeons/") && std::regex_search(xmlPath, dungeonsWithMQ)) {
+ if (Globals::Instance->rom->IsMQ()) {
+ prefix = "scenes/mq";
+ } else {
+ prefix = "scenes/nonmq";
+ }
+ }
+ }
else if (StringHelper::Contains(xmlPath, "objects/"))
prefix = "objects";
else if (StringHelper::Contains(xmlPath, "textures/"))