mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-05-02 22:57:59 +03:00
parent
2a76f6d28a
commit
e1747aa22e
9 changed files with 36 additions and 2 deletions
11
scripts/generate_init
Normal file → Executable file
11
scripts/generate_init
Normal file → Executable 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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue