diff --git a/src/factories/BaseFactory.h b/src/factories/BaseFactory.h index c33caf4f..d7b71e99 100644 --- a/src/factories/BaseFactory.h +++ b/src/factories/BaseFactory.h @@ -23,7 +23,7 @@ #define IS_SEGMENTED(x) ((SEGMENT_NUMBER(x) > 0) && (SEGMENT_NUMBER(x) < 0x20)) #define ASSET_PTR(x) (IS_SEGMENTED(x) ? SEGMENT_OFFSET(x) : (x)) -#define tab "\t" +#define tab_t "\t" #define fourSpaceTab " " struct OffsetEntry { diff --git a/src/factories/BlobFactory.cpp b/src/factories/BlobFactory.cpp index 97a6cc1f..85f15585 100644 --- a/src/factories/BlobFactory.cpp +++ b/src/factories/BlobFactory.cpp @@ -26,11 +26,11 @@ ExportResult BlobCodeExporter::Export(std::ostream &write, std::shared_ptr(node, "ctype", "u8") << " " << symbol << "[] = {\n" << tab; + write << GetSafeNode(node, "ctype", "u8") << " " << symbol << "[] = {\n" << tab_t; for (int i = 0; i < data.size(); i++) { if ((i % 15 == 0) && i != 0) { - write << "\n" << tab; + write << "\n" << tab_t; } write << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int) data[i] << ", "; diff --git a/src/factories/TextureFactory.cpp b/src/factories/TextureFactory.cpp index 7de095ae..34a6362c 100644 --- a/src/factories/TextureFactory.cpp +++ b/src/factories/TextureFactory.cpp @@ -104,7 +104,7 @@ ExportResult TextureHeaderExporter::Export(std::ostream &write, std::shared_ptr< if(end == offset){ write << "static const char* " << name << "[] = {\n"; for(auto& entry : tableEntries){ - write << tab << entry << ",\n"; + write << tab_t << entry << ",\n"; } write << "};\n\n"; tableEntries.clear(); @@ -181,13 +181,13 @@ ExportResult TextureCodeExporter::Export(std::ostream &write, std::shared_ptr(node, "ctype", "u8") << " " << name << "[][" << isize << "] = {\n"; } - write << tab << "{\n"; + write << tab_t << "{\n"; if (!Companion::Instance->IsUsingIndividualIncludes()){ - write << tab << tab << "#include \"" << Companion::Instance->GetOutputPath() + "/" << *replacement << ".inc.c\"\n"; + write << tab_t << tab_t << "#include \"" << Companion::Instance->GetOutputPath() + "/" << *replacement << ".inc.c\"\n"; } else { write << imgstream.str(); } - write << tab << "},\n"; + write << tab_t << "},\n"; if(end == offset){ write << "};\n"; @@ -199,7 +199,7 @@ ExportResult TextureCodeExporter::Export(std::ostream &write, std::shared_ptr(node, "ctype", "u8") << " " << symbol << "[] = {\n"; if (!Companion::Instance->IsUsingIndividualIncludes()){ - write << tab << "#include \"" << Companion::Instance->GetOutputPath() + "/" << *replacement << ".inc.c\"\n"; + write << tab_t << "#include \"" << Companion::Instance->GetOutputPath() + "/" << *replacement << ".inc.c\"\n"; } else { write << imgstream.str(); } diff --git a/src/storm/SWrapper.cpp b/src/storm/SWrapper.cpp index 7abf1be5..811e31bf 100644 --- a/src/storm/SWrapper.cpp +++ b/src/storm/SWrapper.cpp @@ -4,9 +4,9 @@ #include #include "spdlog/spdlog.h" +#include namespace fs = std::filesystem; -bool debugMode = true; SWrapper::SWrapper(const std::string& path) { if(fs::exists(path)) { @@ -20,7 +20,7 @@ SWrapper::SWrapper(const std::string& path) { } bool SWrapper::CreateFile(const std::string& path, std::vector data) { - if(debugMode){ + if(Companion::Instance->IsDebug()){ SPDLOG_INFO("Creating debug file: debug/{}", path); std::string dpath = "debug/" + path; if(!fs::exists(fs::path(dpath).parent_path())){