From d58f5776cb5039e07c93efca1735f887711717d2 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Tue, 20 Feb 2024 17:28:22 -0600 Subject: [PATCH] Added pad generation for all assets --- src/Companion.cpp | 12 ++++++++++++ src/Companion.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/Companion.cpp b/src/Companion.cpp index 3b2b99f1..23721164 100644 --- a/src/Companion.cpp +++ b/src/Companion.cpp @@ -119,6 +119,18 @@ void Companion::ExtractNode(YAML::Node& node, std::string& name, SWrapper* binar } default: { exporter->get()->Export(stream, result.value(), name, node, &name); + + if(this->gConfig.exporterType == ExportType::Code) { + if(node["pad"]){ + auto pad = GetSafeNode(node, "pad"); + stream << "char pad_" << gCurrentPad++ << "[] = {\n"; + for(int i = 0; i < pad; i++){ + stream << "0x00, "; + } + stream << "};\n\n"; + } + } + break; } } diff --git a/src/Companion.h b/src/Companion.h index e0849e04..8af92f08 100644 --- a/src/Companion.h +++ b/src/Companion.h @@ -89,6 +89,7 @@ class Companion { // Temporal Variables std::string gCurrentFile; std::string gFileHeader; + uint32_t gCurrentPad = 0; std::variant, std::string> gWriteOrder; std::unordered_map> gFactories; std::map>> gAssetDependencies;