summaryrefslogtreecommitdiff
path: root/tools/src/asset_processor/assets/exitlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/asset_processor/assets/exitlist.cpp')
-rw-r--r--tools/src/asset_processor/assets/exitlist.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/tools/src/asset_processor/assets/exitlist.cpp b/tools/src/asset_processor/assets/exitlist.cpp
index c4e193c6..ad71dba7 100644
--- a/tools/src/asset_processor/assets/exitlist.cpp
+++ b/tools/src/asset_processor/assets/exitlist.cpp
@@ -2,11 +2,12 @@
#include "reader.h"
#include <fstream>
#include <iostream>
+#include <fmt/format.h>
void ExitListAsset::convertToHumanReadable(const std::vector<char>& baserom) {
- Reader reader(baserom, this->start, this->size);
+ Reader reader(baserom, start, size);
std::vector<std::string> lines;
- while (reader.cursor < this->size) {
+ while (reader.cursor < size) {
u16 transition_type = reader.read_u16();
u16 x_pos = reader.read_u16();
u16 y_pos = reader.read_u16();
@@ -21,26 +22,26 @@ void ExitListAsset::convertToHumanReadable(const std::vector<char>& baserom) {
u16 unknown_5 = reader.read_u16();
u16 padding_1 = reader.read_u16();
if (transition_type == 0xffff) {
- lines.push_back("\texit_list_end\n");
+ lines.emplace_back("\texit_list_end\n");
break;
}
- lines.push_back(string_format("\texit transition=%d", transition_type));
- lines.push_back(opt_param(", x=0x%x", 0, x_pos));
- lines.push_back(opt_param(", y=0x%x", 0, y_pos));
- lines.push_back(opt_param(", destX=0x%x", 0, dest_x));
- lines.push_back(opt_param(", destY=0x%x", 0, dest_y));
- lines.push_back(opt_param(", screenEdge=0x%x", 0, screen_edge));
- lines.push_back(opt_param(", destArea=0x%x", 0, dest_area));
- lines.push_back(opt_param(", destRoom=0x%x", 0, dest_room));
- lines.push_back(opt_param(", unknown=0x%x", 0, unknown_2));
- lines.push_back(opt_param(", unknown2=0x%x", 0, unknown_3));
- lines.push_back(opt_param(", unknown3=0x%x", 0, unknown_4));
- lines.push_back(opt_param(", unknown4=0x%x", 0, unknown_5));
- lines.push_back(opt_param(", padding=0x%x", 0, padding_1));
- lines.push_back("\n");
+ lines.push_back(fmt::format("\texit transition={}", transition_type));
+ lines.push_back(opt_param(", x={:#x}", 0, x_pos));
+ lines.push_back(opt_param(", y={:#x}", 0, y_pos));
+ lines.push_back(opt_param(", destX={:#x}", 0, dest_x));
+ lines.push_back(opt_param(", destY={:#x}", 0, dest_y));
+ lines.push_back(opt_param(", screenEdge={:#x}", 0, screen_edge));
+ lines.push_back(opt_param(", destArea={:#x}", 0, dest_area));
+ lines.push_back(opt_param(", destRoom={:#x}", 0, dest_room));
+ lines.push_back(opt_param(", unknown={:#x}", 0, unknown_2));
+ lines.push_back(opt_param(", unknown2={:#x}", 0, unknown_3));
+ lines.push_back(opt_param(", unknown3={:#x}", 0, unknown_4));
+ lines.push_back(opt_param(", unknown4={:#x}", 0, unknown_5));
+ lines.push_back(opt_param(", padding={:#x}", 0, padding_1));
+ lines.emplace_back("\n");
}
- std::ofstream out(this->assetPath);
+ std::ofstream out(assetPath);
for (const auto& line : lines) {
out << line;
}