inv: add T1M version in the corner

Closes #155
This commit is contained in:
rr- 2021-11-05 18:23:49 +01:00 committed by Marcin Kurczewski
parent 2a76f6d28a
commit e1747aa22e
9 changed files with 36 additions and 2 deletions

11
scripts/generate_init Normal file → Executable file
View file

@ -1,5 +1,7 @@
from pathlib import Path
#!/usr/bin/env python3
import json
from pathlib import Path
import pyjson5
REPO_DIR = Path(__file__).parent.parent
@ -11,6 +13,7 @@ def main() -> None:
gf = pyjson5.loads(
(CONFIG_DIR / "Tomb1Main_gameflow.json5").read_text(encoding="utf-8")
)
with (SRC_DIR / "init.c").open("w") as handle:
print('#include "init.h"', file=handle)
print(file=handle)
@ -19,6 +22,12 @@ def main() -> None:
print("// THIS IS AN AUTOGENERATED FILE.", file=handle)
print("// To generate it, run scripts/generate_init.", file=handle)
print("", file=handle)
print("#ifndef VERSION", file=handle)
print(' #define VERSION "T1M (unknown version)"', file=handle)
print("#endif", file=handle)
print("", file=handle)
print("const char *T1MVersion = VERSION;", file=handle)
print("", file=handle)
print("void T1MInit()", file=handle)
print("{", file=handle)
for key, value in gf["strings"].items():