Skip to content

Commit

Permalink
Place shared scenes in their own location (#11)
Browse files Browse the repository at this point in the history
* separate shared scene exports from dungeons

* use regex for only main dungeons
  • Loading branch information
Archez committed Nov 5, 2023
1 parent cde9a3b commit 0d8f557
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions OTRExporter/DisplayListExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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/"))
Expand Down

0 comments on commit 0d8f557

Please sign in to comment.