From cff4da2dfa4d359cafdbbbdfab2e990c2a3a3fab Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Sun, 30 Jul 2023 20:01:35 +0000 Subject: [PATCH] Remove TODOs now that we have correct sample files, fix BGRA mode to fix JC9 font decoding. --- bemani/format/afp/container.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bemani/format/afp/container.py b/bemani/format/afp/container.py index 29cfc52..35e3d76 100644 --- a/bemani/format/afp/container.py +++ b/bemani/format/afp/container.py @@ -579,15 +579,14 @@ class TXP2File(TrackedCoverage, VerboseOutput): "RGB", ) elif fmt == 0x10: - # Seems to be some sort of RGB with color swapping. Game references D3D9 texture + # Seems to be some sort of RGBA with color swapping. Game references D3D9 texture # format 21 (A8R8B8G8) but does manual byteswapping. - # TODO: Not sure this is correct, need to find sample files. img = Image.frombytes( - "RGB", + "RGBA", (width, height), raw_data[64:], "raw", - "BGR", + "BGRA", ) elif fmt == 0x13: # Some 16-bit texture format. Game references D3D9 texture format 25 (A1R5G5B5). @@ -622,7 +621,6 @@ class TXP2File(TrackedCoverage, VerboseOutput): elif fmt == 0x15: # RGBA format. Game references D3D9 texture format 21 (A8R8G8B8). # Looks like unlike 0x20 below, the game does some endianness swapping. - # TODO: Not sure this is correct, need to find sample files. img = Image.frombytes( "RGBA", (width, height),