diff options
Diffstat (limited to 'tools/asset_packer.cc')
| -rw-r--r-- | tools/asset_packer.cc | 17 |
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 |
