From 18eb8a07ba39a8aad1c75521cee027b9c9c72e40 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 00:58:20 +0100 Subject: clang-format --- tools/asset_packer.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'tools/asset_packer.cc') diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc index 4a2e631..c803c02 100644 --- a/tools/asset_packer.cc +++ b/tools/asset_packer.cc @@ -8,7 +8,7 @@ #include #include -int main(int argc, char *argv[]) { +int main(int argc, char* argv[]) { if (argc != 4) { std::cerr << "Usage: " << argv[0] << " " @@ -59,17 +59,20 @@ int main(int argc, char *argv[]) { std::vector asset_names; while (std::getline(assets_txt_file, line)) { - if (line.empty() || line[0] == '#') continue; + if (line.empty() || line[0] == '#') + continue; size_t first_comma = line.find(','); - if (first_comma == std::string::npos) continue; + if (first_comma == std::string::npos) + continue; std::string asset_name = line.substr(0, first_comma); asset_name.erase(0, asset_name.find_first_not_of(" \t\r\n")); asset_name.erase(asset_name.find_last_not_of(" \t\r\n") + 1); size_t second_comma = line.find(',', first_comma + 1); - if (second_comma == std::string::npos) continue; + if (second_comma == std::string::npos) + continue; std::string filename = line.substr(first_comma + 1, second_comma - first_comma - 1); @@ -99,13 +102,14 @@ int main(int argc, char *argv[]) { assets_data_cc_file << "static const uint8_t ASSET_DATA_" << asset_name << "[] = {"; for (size_t i = 0; i < buffer.size(); ++i) { - if (i % 12 == 0) assets_data_cc_file << "\n "; + if (i % 12 == 0) + assets_data_cc_file << "\n "; assets_data_cc_file << "0x" << std::hex << (int)buffer[i] << std::dec << (i == buffer.size() - 1 ? "" : ", "); } assets_data_cc_file << "\n};\n\n"; - asset_id_counter++; + ++asset_id_counter; } assets_h_file << "};\n\n"; @@ -114,7 +118,7 @@ int main(int argc, char *argv[]) { // Generate the lookup array in assets_data.cc assets_data_cc_file << "extern const AssetRecord g_assets[] = {\n"; - for (const std::string &name : asset_names) { + for (const std::string& name : asset_names) { assets_data_cc_file << " { ASSET_DATA_" << name << ", sizeof(ASSET_DATA_" << name << ") },\n"; } -- cgit v1.2.3