diff --git a/tools/make_game.py b/tools/make_game.py index 56204170..5ec74030 100644 --- a/tools/make_game.py +++ b/tools/make_game.py @@ -1001,8 +1001,46 @@ def windres_command(msys, rco): *(f'--preprocessor-arg={a}' for a in pp), '-O', 'coff', '-i', 'nx2navi.rc', '-o', str(rco)] -def compile_resources(msys, rt, obj, env): - """runtime/nx2navi.rc into obj/nx2navi_rc.o: the manifest of the game's exe (per-monitor DPI awareness, so the +RC_LINE = re.compile(r'(\d+)\s+(24|ICON)\s+"([^"]+)"') + + +def resource_file(rt): + """runtime/nx2navi.rc as a .res file (the format Windows' resource compiler writes): the manifest as resource 24, + the icon's images as RT_ICON 1..n and their directory as RT_GROUP_ICON, US English as windres gives them. lld + takes a .res among its inputs and builds the exe's resource section from it. + + Python writes it, so no tool opens a path by the system's ANSI code page: windres does (binutils), and a build + folder or a user folder whose name holds a character outside that code page (C:\\Users\\Víctor on a Cyrillic or a + Japanese Windows, D:\\Games\\Zelda:Ocarina) failed with "Invalid argument" or "Cannot create temporary file".""" + def resource(typ, name, data, flags): + head = struct.pack('