removed some unnecessary vectors

This commit is contained in:
Henny022p
2021-11-30 04:28:49 +01:00
parent c498ec163e
commit 029ce60b3d
6 changed files with 51 additions and 62 deletions
@@ -5,20 +5,16 @@
void SpriteFrameAsset::convertToHumanReadable(const std::vector<char>& baserom) {
Reader reader(baserom, start, size);
std::vector<std::string> lines;
auto file = util::open_file(assetPath, "w");
while (reader.cursor < size) {
u8 num_gfx_tiles = reader.read_u8();
u8 unk = reader.read_u8();
u16 first_gfx_tile_index = reader.read_u16();
lines.push_back(fmt::format("\tsprite_frame first_tile_index={:#x}", first_gfx_tile_index));
lines.push_back(opt_param(", num_tiles={}", 0, num_gfx_tiles));
lines.push_back(opt_param(", unknown={:#x}", 0, unk));
lines.emplace_back("\n");
}
auto file = util::open_file(assetPath, "w");
for (const auto& line : lines) {
auto line = fmt::format("\tsprite_frame first_tile_index={:#x}", first_gfx_tile_index);
line += opt_param(", num_tiles={}", 0, num_gfx_tiles);
line += opt_param(", unknown={:#x}", 0, unk);
std::fputs(line.c_str(), file.get());
std::fputc('\n', file.get());
}
}