mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Fixed tab define conflicting with imgui
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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] << ", ";
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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())){
|
||||
|
||||
Reference in New Issue
Block a user