summaryrefslogtreecommitdiff
path: root/scripts/create_empty_assets.py
diff options
context:
space:
mode:
authorIndrajith K L2025-11-10 01:58:00 +0530
committerIndrajith K L2025-11-10 01:58:25 +0530
commitd9d1a8a51ea7cd7e7076724918008b6adb1302ca (patch)
tree59a8f258c9bb4db4edafc2c70993319e3c3c859c /scripts/create_empty_assets.py
parent8c9367f3689aee05d33fc1cae8a5d1aa6d2b5fb8 (diff)
downloadreilua-enhanced-d9d1a8a51ea7cd7e7076724918008b6adb1302ca.tar.gz
reilua-enhanced-d9d1a8a51ea7cd7e7076724918008b6adb1302ca.tar.bz2
reilua-enhanced-d9d1a8a51ea7cd7e7076724918008b6adb1302ca.zip
Add flexible module loading and complete file embedding
- Support any folder structure (no hard-coded folders) - Embed all file types recursively from any folder - Fix require() dot-to-slash conversion for embedded modules - Clean build folder for fresh builds every time - Generate empty headers for Lua-only projects Backward compatible with existing projects.
Diffstat (limited to 'scripts/create_empty_assets.py')
-rw-r--r--scripts/create_empty_assets.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/create_empty_assets.py b/scripts/create_empty_assets.py
new file mode 100644
index 0000000..fbc2d11
--- /dev/null
+++ b/scripts/create_empty_assets.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+"""
+Create an empty embedded_assets.h file for compatibility.
+Usage: python create_empty_assets.py <output.h>
+"""
+import sys
+
+if __name__ == '__main__':
+ if len(sys.argv) < 2:
+ print('Usage: python create_empty_assets.py <output.h>')
+ sys.exit(1)
+
+ output_file = sys.argv[1]
+
+ with open(output_file, 'w') as f:
+ f.write('#ifndef EMBEDDED_ASSETS_H\n')
+ f.write('#define EMBEDDED_ASSETS_H\n')
+ f.write('/* No assets to embed */\n')
+ f.write('typedef struct { const char* name; const unsigned char* data; unsigned int size; } EmbeddedAsset;\n')
+ f.write('static const EmbeddedAsset embedded_assets[] = {};\n')
+ f.write('static const int embedded_asset_count = 0;\n')
+ f.write('#endif\n')
+
+ print(f'Created empty {output_file}')