From bc4a8577f3f139a8d0b420e2decbbb9701d25c4c Mon Sep 17 00:00:00 2001 From: Henny022p Date: Tue, 23 Nov 2021 05:40:41 +0100 Subject: moved asset_processor to new location --- tools/src/asset_processor/assets/macroasm.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/src/asset_processor/assets/macroasm.cpp (limited to 'tools/src/asset_processor/assets/macroasm.cpp') diff --git a/tools/src/asset_processor/assets/macroasm.cpp b/tools/src/asset_processor/assets/macroasm.cpp new file mode 100644 index 00000000..c87f355b --- /dev/null +++ b/tools/src/asset_processor/assets/macroasm.cpp @@ -0,0 +1,20 @@ +#include "macroasm.h" +#include + +std::filesystem::path BaseMacroAsmAsset::generateAssetPath() { + std::filesystem::path path = this->path; + return path.replace_extension(".s"); +} + +std::filesystem::path BaseMacroAsmAsset::generateBuildPath() { + std::filesystem::path path = this->path; + return path.replace_extension(".s"); +} + +void BaseMacroAsmAsset::extractBinary(const std::vector& baserom) { + BaseAsset::extractBinary(baserom); + // Create dummy .s file that just incbins the .bin file. + std::ofstream out(this->assetPath); + out << "\t.incbin " << this->path << "\n"; + out.close(); +} \ No newline at end of file -- cgit v1.2.3 From 794d5fc97cb01a70c8579dc08962b667edf5a29e Mon Sep 17 00:00:00 2001 From: Henny022p Date: Tue, 23 Nov 2021 20:22:22 +0100 Subject: cleaned asset_processor to build without warnings --- tools/src/asset_processor/assets/macroasm.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/src/asset_processor/assets/macroasm.cpp') diff --git a/tools/src/asset_processor/assets/macroasm.cpp b/tools/src/asset_processor/assets/macroasm.cpp index c87f355b..f20d48ec 100644 --- a/tools/src/asset_processor/assets/macroasm.cpp +++ b/tools/src/asset_processor/assets/macroasm.cpp @@ -2,19 +2,19 @@ #include std::filesystem::path BaseMacroAsmAsset::generateAssetPath() { - std::filesystem::path path = this->path; - return path.replace_extension(".s"); + std::filesystem::path asset_path = path; + return asset_path.replace_extension(".s"); } std::filesystem::path BaseMacroAsmAsset::generateBuildPath() { - std::filesystem::path path = this->path; - return path.replace_extension(".s"); + std::filesystem::path build_path = path; + return build_path.replace_extension(".s"); } void BaseMacroAsmAsset::extractBinary(const std::vector& baserom) { BaseAsset::extractBinary(baserom); // Create dummy .s file that just incbins the .bin file. - std::ofstream out(this->assetPath); - out << "\t.incbin " << this->path << "\n"; + std::ofstream out(assetPath); + out << "\t.incbin " << path << "\n"; out.close(); } \ No newline at end of file -- cgit v1.2.3 From 25c9367d1730f1419abcbe6154d8391034f67d34 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Sat, 27 Nov 2021 08:32:17 +0100 Subject: replace fstream with fmt::print --- tools/src/asset_processor/assets/macroasm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/src/asset_processor/assets/macroasm.cpp') diff --git a/tools/src/asset_processor/assets/macroasm.cpp b/tools/src/asset_processor/assets/macroasm.cpp index f20d48ec..c64df2e1 100644 --- a/tools/src/asset_processor/assets/macroasm.cpp +++ b/tools/src/asset_processor/assets/macroasm.cpp @@ -1,5 +1,6 @@ #include "macroasm.h" -#include +#include +#include std::filesystem::path BaseMacroAsmAsset::generateAssetPath() { std::filesystem::path asset_path = path; @@ -14,7 +15,6 @@ std::filesystem::path BaseMacroAsmAsset::generateBuildPath() { void BaseMacroAsmAsset::extractBinary(const std::vector& baserom) { BaseAsset::extractBinary(baserom); // Create dummy .s file that just incbins the .bin file. - std::ofstream out(assetPath); - out << "\t.incbin " << path << "\n"; - out.close(); + auto file = util::open_file(assetPath, "w"); + fmt::print(file.get(), "\t.incbin \"{}\"\n", path.native()); } \ No newline at end of file -- cgit v1.2.3