summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiritoDv <kiritodev01@gmail.com>2024-05-26 01:48:04 -0600
committerKiritoDv <kiritodev01@gmail.com>2024-05-26 01:48:04 -0600
commit06bc15d535b3cd623814be3b51d7a916cee8cb59 (patch)
tree2ea340592e53afe7d6718c6bc665fb54eea0973c
parentafd800afc0bad0dd034eb732354ed25c81621d2e (diff)
Fixed tab define conflicting with imgui
-rw-r--r--src/factories/BaseFactory.h2
-rw-r--r--src/factories/BlobFactory.cpp4
-rw-r--r--src/factories/TextureFactory.cpp10
-rw-r--r--src/storm/SWrapper.cpp4
4 files changed, 10 insertions, 10 deletions
diff --git a/src/factories/BaseFactory.h b/src/factories/BaseFactory.h
index c33caf4..d7b71e9 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 97a6cc1..85f1558 100644
--- a/src/factories/BlobFactory.cpp
+++ b/src/factories/BlobFactory.cpp
@@ -26,11 +26,11 @@ ExportResult BlobCodeExporter::Export(std::ostream &write, std::shared_ptr<IPars
return std::nullopt;
}
- write << GetSafeNode<std::string>(node, "ctype", "u8") << " " << symbol << "[] = {\n" << tab;
+ write << GetSafeNode<std::string>(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 7de095a..34a6362 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<IP
write << GetSafeNode<std::string>(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<IP
write << GetSafeNode<std::string>(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 7abf1be..811e31b 100644
--- a/src/storm/SWrapper.cpp
+++ b/src/storm/SWrapper.cpp
@@ -4,9 +4,9 @@
#include <fstream>
#include "spdlog/spdlog.h"
+#include <Companion.h>
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<char> 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())){