summaryrefslogtreecommitdiff
path: root/tools/asset_packer.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-31 21:11:11 +0100
committerskal <pascal.massimino@gmail.com>2026-01-31 21:11:11 +0100
commit25e693cc46324b4ec588530de542bba8af6f47c6 (patch)
tree8a959e442f9330dd3f881fe4109e83b831f25a7e /tools/asset_packer.cc
parent9379697ccdf6f44ade7933d5635f72f644f6b92e (diff)
style: add vertical compression rules to clang-format
- Enabled AllowShortFunctionsOnASingleLine: All - Enabled AllowShortBlocksOnASingleLine: Always - Enabled AllowShortIfStatementsOnASingleLine: Always - Enabled AllowShortLoopsOnASingleLine: true - Set MaxEmptyLinesToKeep: 1 - Applied formatting to all source files.
Diffstat (limited to 'tools/asset_packer.cc')
-rw-r--r--tools/asset_packer.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc
index 6e939cf..4a2e631 100644
--- a/tools/asset_packer.cc
+++ b/tools/asset_packer.cc
@@ -59,20 +59,17 @@ int main(int argc, char *argv[]) {
std::vector<std::string> 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);
@@ -102,8 +99,7 @@ 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 ? "" : ", ");
}