2024-06-19 07:39:01 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
|
|
|
|
parser.add_argument("input")
|
|
|
|
parser.add_argument("output")
|
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
script = Path(args.input).read_text().replace("\n", "\\n").replace('"', '\\"')
|
|
|
|
|
2024-06-25 21:08:04 +00:00
|
|
|
code = f"""#include <game.h>
|
|
|
|
const char * program = "{script}";
|
2024-06-19 07:39:01 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
with open(args.output, 'w') as f:
|
|
|
|
f.write(code)
|