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/exitlist.cpp | 37 ++++++++++++++------------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'tools/src/asset_processor/assets/exitlist.cpp') 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 #include +#include void ExitListAsset::convertToHumanReadable(const std::vector& baserom) { - Reader reader(baserom, this->start, this->size); + Reader reader(baserom, start, size); std::vector 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& 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; } -- cgit v1.2.3