Skip to content

Commit

Permalink
Fixed tab define conflicting with imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed May 26, 2024
1 parent afd800a commit 06bc15d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/factories/BaseFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/factories/BlobFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] << ", ";
Expand Down
10 changes: 5 additions & 5 deletions src/factories/TextureFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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";
Expand All @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/storm/SWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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())){
Expand Down

0 comments on commit 06bc15d

Please sign in to comment.