summaryrefslogtreecommitdiff
path: root/tools/asset_packer.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-28 09:31:13 +0100
committerskal <pascal.massimino@gmail.com>2026-01-28 09:31:13 +0100
commit302d883f34864bc66a5e04532ae27d7e89fd94e8 (patch)
tree8f813865d5dc5b70ee8bf9ee4866546116859825 /tools/asset_packer.cc
parentf804dcb9740540b3735628ebf8c006235cc56fca (diff)
style: Add 3-line descriptive headers to all source files
This commit applies a new project-wide rule that every source file must begin with a concise 3-line comment header describing its purpose. - Updated CONTRIBUTING.md with the new rule. - Applied headers to all .cc and .h files in src/ and tools/. - Fixed various minor compilation errors and missing includes discovered during the header update process.
Diffstat (limited to 'tools/asset_packer.cc')
-rw-r--r--tools/asset_packer.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc
index a67ddcc..8696646 100644
--- a/tools/asset_packer.cc
+++ b/tools/asset_packer.cc
@@ -1,3 +1,7 @@
+// This file is part of the 64k demo project.
+// It implements the asset packer tool for demoscene resource management.
+// Converts external files into embedded C++ byte arrays.
+
#include <fstream>
#include <iostream>
#include <map>
@@ -39,8 +43,8 @@ int main(int argc, char *argv[]) {
// Generate assets.h
assets_h_file << "#pragma once\n";
- assets_h_file << "#include <cstdint>\n";
- assets_h_file << "#include <cstddef>\n\n";
+ assets_h_file << "#include <cstddef>\n";
+ assets_h_file << "#include <cstdint>\n\n";
assets_h_file << "enum class AssetId : uint16_t {\n";
// Generate assets_data.cc header
@@ -109,8 +113,8 @@ int main(int argc, char *argv[]) {
<< (i == buffer.size() - 1 ? "" : ", ");
}
assets_data_cc_file << "\n};\n";
- assets_data_cc_file << "const size_t ASSET_SIZE_" << asset_name << " = "
- << buffer.size() << ";\n\n";
+ assets_data_cc_file << "const size_t ASSET_SIZE_" << asset_name
+ << " = " << buffer.size() << ";\n\n";
asset_id_counter++;
}
@@ -120,9 +124,8 @@ int main(int argc, char *argv[]) {
// Generate GetAsset function declaration in assets.h
assets_h_file << "const uint8_t *GetAsset(AssetId asset_id, size_t *out_size "
"= nullptr);\n";
- assets_h_file
- << "void DropAsset(AssetId asset_id, const uint8_t *asset); // For lazy "
- "decompression scaffolding\n";
+ assets_h_file << "void DropAsset(AssetId asset_id, const uint8_t *asset); // "
+ "For lazy decompression scaffolding\n";
assets_h_file.close();
// Generate GetAsset function implementation in assets_data.cc