mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-30 23:10:14 -05:00
OTRGui downgrade to OpenGL 2.1 and fixed folder issues
This commit is contained in:
parent
4a05b32755
commit
b9ab528717
@ -41,6 +41,8 @@ void OTRGame::preload() {
|
||||
}
|
||||
|
||||
void cleanTempData() {
|
||||
MoonUtils::rm("assets/extractor/xmls/output");
|
||||
MoonUtils::rm("Extract/");
|
||||
MoonUtils::rm("tmp/");
|
||||
MoonUtils::mkdir("tmp/");
|
||||
}
|
||||
@ -67,7 +69,7 @@ void OTRGame::init(){
|
||||
|
||||
if(fs::exists("soh.exe") && !fs::exists("oot.otr")) {
|
||||
hide_second_btn = true;
|
||||
sohFolder = ".";
|
||||
sohFolder = "MAIN";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,93 +56,18 @@ RomVersion GetVersion(FILE* rom) {
|
||||
|
||||
version.crc = __bswap_32(version.crc);
|
||||
switch (version.crc) {
|
||||
case OOT_NTSC_10:
|
||||
version.version = "N64 NTSC 1.0";
|
||||
version.listPath = "ntsc_oot.txt";
|
||||
version.offset = OOT_OFF_NTSC_10;
|
||||
break;
|
||||
case OOT_NTSC_11:
|
||||
version.version = "N64 NTSC 1.1";
|
||||
version.listPath = "ntsc_oot.txt";
|
||||
version.offset = OOT_OFF_NTSC_11;
|
||||
break;
|
||||
case OOT_NTSC_12:
|
||||
version.version = "N64 NTSC 1.2";
|
||||
version.listPath = "ntsc_oot.txt";
|
||||
version.offset = OOT_OFF_NTSC_12;
|
||||
break;
|
||||
case OOT_PAL_10:
|
||||
version.version = "N64 PAL 1.0";
|
||||
version.listPath = "pal_oot.txt";
|
||||
version.offset = OOT_OFF_PAL_10;
|
||||
break;
|
||||
case OOT_PAL_11:
|
||||
version.version = "N64 PAL 1.1";
|
||||
version.listPath = "pal_oot.txt";
|
||||
version.offset = OOT_OFF_PAL_11;
|
||||
break;
|
||||
case OOT_NTSC_JP_GC:
|
||||
version.version = "JP GameCube (MQ Disk)";
|
||||
version.listPath = "gamecube_mq.txt";
|
||||
version.offset = OOT_OFF_JP_GC;
|
||||
break;
|
||||
case OOT_NTSC_JP_GC_CE:
|
||||
version.version = "GameCube (Collectors Edition Disk)";
|
||||
version.listPath = "gamecube_mq.txt";
|
||||
version.offset = OOT_OFF_JP_GC_CE;
|
||||
break;
|
||||
case OOT_NTSC_JP_MQ:
|
||||
version.version = "JP Master Quest";
|
||||
version.listPath = "gamecube_mq.txt";
|
||||
version.offset = OOT_OFF_JP_MQ;
|
||||
break;
|
||||
case OOT_NTSC_US_MQ:
|
||||
version.version = "NTSC Master Quest";
|
||||
version.listPath = "gamecube_mq.txt";
|
||||
version.offset = OOT_OFF_JP_MQ;
|
||||
break;
|
||||
case OOT_NTSC_US_GC:
|
||||
version.version = "NTSC GameCube";
|
||||
version.listPath = "gamecube_mq.txt";
|
||||
version.offset = OOT_OFF_US_MQ;
|
||||
break;
|
||||
case OOT_PAL_GC:
|
||||
version.version = "PAL GameCube";
|
||||
version.listPath = "gamecube_mq.txt";
|
||||
version.offset = OOT_OFF_PAL_GC;
|
||||
break;
|
||||
case OOT_PAL_MQ:
|
||||
version.version = "PAL Master Quest";
|
||||
version.listPath = "pal_mq.txt";
|
||||
version.offset = OOT_OFF_PAL_MQ;
|
||||
break;
|
||||
case OOT_PAL_GC_DBG1:
|
||||
version.version = "GameCube Debug 1.0";
|
||||
version.listPath = "dbg.txt";
|
||||
version.offset = OOT_OFF_PAL_GC_DBG1;
|
||||
break;
|
||||
case OOT_PAL_GC_DBG2:
|
||||
version.version = "GameCube Debug 2.0";
|
||||
version.listPath = "dbg.txt";
|
||||
version.offset = OOT_OFF_PAL_GC_DBG2;
|
||||
break;
|
||||
case OOT_PAL_GC_MQ_DBG:
|
||||
version.version = "GameCube MQ-Debug";
|
||||
version.listPath = "dbg.txt";
|
||||
version.offset = OOT_OFF_PAL_MQ_DBG;
|
||||
break;
|
||||
case OOT_IQUE_CN:
|
||||
version.version = "OoT IQue";
|
||||
version.listPath = "ique.txt";
|
||||
version.offset = OOT_OFF_CN_IQUE;
|
||||
break;
|
||||
case OOT_IQUE_TW:
|
||||
version.version = "TW IQue";
|
||||
version.listPath = "ique.txt";
|
||||
version.offset = OOT_OFF_TW_IQUE;
|
||||
break;
|
||||
default:
|
||||
version.error = MoonUtils::format("Unknown CRC %x given: ", version.crc);
|
||||
case OOT_PAL_GC_DBG1:
|
||||
version.version = "GameCube Debug 1.0";
|
||||
version.listPath = "dbg.txt";
|
||||
version.offset = OOT_OFF_PAL_GC_DBG1;
|
||||
break;
|
||||
case OOT_PAL_GC_DBG2:
|
||||
version.version = "GameCube Debug 2.0";
|
||||
version.listPath = "dbg.txt";
|
||||
version.offset = OOT_OFF_PAL_GC_DBG2;
|
||||
break;
|
||||
default:
|
||||
version.error = MoonUtils::format("Unknown CRC %x given: ", version.crc);
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ void BuildOTR(const std::string output) {
|
||||
}
|
||||
setCurrentStep("Done!");
|
||||
|
||||
if (output == ".") return;
|
||||
if (output == "MAIN" || Util::normalize(output) == Util::normalize(fs::current_path().string())) return;
|
||||
const std::string outputPath = MoonUtils::join(output, "oot.otr");
|
||||
if(MoonUtils::exists(outputPath)) MoonUtils::rm(outputPath);
|
||||
|
||||
@ -73,7 +73,7 @@ void startWorker() {
|
||||
const int num_threads = std::thread::hardware_concurrency();
|
||||
ctpl::thread_pool pool(num_threads / 2);
|
||||
for(auto &file : files) {
|
||||
if (file.find(".xml") != std::string::npos) xmlFiles.push_back(file);
|
||||
if (MoonUtils::endsWith(file, ".xml")) xmlFiles.push_back(file);
|
||||
}
|
||||
|
||||
for (auto& file : xmlFiles) {
|
||||
|
@ -51,6 +51,11 @@ namespace MoonUtils {
|
||||
return path;
|
||||
}
|
||||
|
||||
bool endsWith(const std::string& str, const char* suffix) {
|
||||
const int suffixLen = basic_string<char>::traits_type::length(suffix);
|
||||
return str.size() >= suffixLen && 0 == str.compare(str.size() - suffixLen, suffixLen, suffix, suffixLen);
|
||||
}
|
||||
|
||||
string join(string base, string file){
|
||||
if( file == "/" ) return normalize(base + file);
|
||||
return normalize( (fs::path(base) / fs::path(file)).string() );
|
||||
|
@ -44,6 +44,7 @@ namespace MoonUtils {
|
||||
void writeFile(std::string path, std::string content);
|
||||
void dirscan(std::string path, std::vector<std::string> &files);
|
||||
std::string extname(std::string file);
|
||||
bool endsWith(const std::string& str, const char* suffix);
|
||||
std::wstring wide(const std::string& str);
|
||||
std::string narrow(const std::wstring& str);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user