Skip to content

Commit

Permalink
Added pad generation for all assets
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed Feb 20, 2024
1 parent b184c7e commit d58f577
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Companion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>(node, "pad");
stream << "char pad_" << gCurrentPad++ << "[] = {\n";
for(int i = 0; i < pad; i++){
stream << "0x00, ";
}
stream << "};\n\n";
}
}

break;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Companion.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class Companion {
// Temporal Variables
std::string gCurrentFile;
std::string gFileHeader;
uint32_t gCurrentPad = 0;
std::variant<std::vector<std::string>, std::string> gWriteOrder;
std::unordered_map<std::string, std::shared_ptr<BaseFactory>> gFactories;
std::map<std::string, std::map<std::string, std::pair<YAML::Node, bool>>> gAssetDependencies;
Expand Down

0 comments on commit d58f577

Please sign in to comment.