This repository has been archived on 2026-04-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
kolyah-game-2025/file_to_header.py
2026-04-01 23:25:51 +02:00

9 lines
260 B
Python

import sys
import pathlib
fname = pathlib.Path(sys.argv[1]).stem
data = open(sys.argv[1], 'rb').read()
print(f'inline uint8_t {fname}_data[{hex(len(data))}] = {{{",".join(map(hex, data))}}};')
print(f'\nconstexpr auto {fname}_data_size = {hex(len(data))};')