summaryrefslogtreecommitdiff
path: root/tools/src/asset_processor/assets/spriteframe.cpp
diff options
context:
space:
mode:
authorHenny022p <info@henny022.de>2021-11-23 05:40:41 +0100
committerHenny022p <info@henny022.de>2021-11-23 05:40:41 +0100
commitbc4a8577f3f139a8d0b420e2decbbb9701d25c4c (patch)
tree180a00ab6fb3a51ec6776747610e56e231f4140e /tools/src/asset_processor/assets/spriteframe.cpp
parent47a3e614a01598cf28f9f484c5405b522fd789fe (diff)
moved asset_processor to new location
Diffstat (limited to 'tools/src/asset_processor/assets/spriteframe.cpp')
-rw-r--r--tools/src/asset_processor/assets/spriteframe.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/src/asset_processor/assets/spriteframe.cpp b/tools/src/asset_processor/assets/spriteframe.cpp
new file mode 100644
index 00000000..6aea52cf
--- /dev/null
+++ b/tools/src/asset_processor/assets/spriteframe.cpp
@@ -0,0 +1,25 @@
+#include "spriteframe.h"
+#include "reader.h"
+#include <fstream>
+#include <iostream>
+
+void SpriteFrameAsset::convertToHumanReadable(const std::vector<char>& baserom) {
+ Reader reader(baserom, this->start, this->size);
+ std::vector<std::string> lines;
+ while (reader.cursor < this->size) {
+ u8 num_gfx_tiles = reader.read_u8();
+ u8 unk = reader.read_u8();
+ u16 first_gfx_tile_index = reader.read_u16();
+
+ lines.push_back(string_format("\tsprite_frame first_tile_index=0x%x", first_gfx_tile_index));
+ lines.push_back(opt_param(", num_tiles=%d", 0, num_gfx_tiles));
+ lines.push_back(opt_param(", unknown=0x%x", 0, unk));
+ lines.push_back("\n");
+ }
+
+ std::ofstream out(this->assetPath);
+ for (const auto& line : lines) {
+ out << line;
+ }
+ out.close();
+} \ No newline at end of file