From d9d1a8a51ea7cd7e7076724918008b6adb1302ca Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 10 Nov 2025 01:58:00 +0530 Subject: 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. --- scripts/create_empty_assets.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/create_empty_assets.py (limited to 'scripts/create_empty_assets.py') 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 +""" +import sys + +if __name__ == '__main__': + if len(sys.argv) < 2: + print('Usage: python create_empty_assets.py ') + 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}') -- cgit v1.2.3