mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 20:12:30 +01:00
7cb1790789
* generate c includes for img segments * flatten battle/item/dusty_hammer.c needs custom splat * use .inc.c for c incbins * fixy * new stuff * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "6120d18600" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "6120d18600" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * remove dumb * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "8a179e74ba" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "8a179e74ba" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * yaml cleaning * Further yaml cleanup & battle item refactor * remove rawptr * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "fe30b60b75" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "fe30b60b75" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * further cleanup * Further cleanup & match gfx_draw_background * clean & wip Co-authored-by: Alex Bates <hi@imalex.xyz>
26 lines
568 B
Python
26 lines
568 B
Python
#! /usr/bin/python3
|
|
|
|
from sys import argv
|
|
import re
|
|
import png
|
|
|
|
if __name__ == "__main__":
|
|
infile, outfile = argv[1:]
|
|
|
|
cname = re.sub(r"[^0-9a-zA-Z_]", "_", outfile)
|
|
|
|
if cname.startswith("ver_"):
|
|
cname = "_".join(cname.split("_")[2:])
|
|
|
|
cname = re.sub(r"^build_include_", "", cname)
|
|
cname = re.sub(r"_inc_c$", "", cname)
|
|
|
|
with open(outfile, "w") as f:
|
|
f.write(f"unsigned char {cname}[] = {{")
|
|
|
|
with open(infile, "rb") as i:
|
|
for char in i.read():
|
|
f.write(f"{char},")
|
|
|
|
f.write(f"}};\n")
|