From 09e7228e1d642ef00938e4fa4bbb8a0598462076 Mon Sep 17 00:00:00 2001 From: Alex Bates <16batesa@gmail.com> Date: Mon, 21 Dec 2020 23:46:14 +0000 Subject: [PATCH] fix sprite component xyz signedness --- tools/compile_npc_sprite.py | 6 +++--- tools/splat_ext/PaperMarioNpcSprites.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/compile_npc_sprite.py b/tools/compile_npc_sprite.py index 6a8f8d42f2..39a7d96005 100755 --- a/tools/compile_npc_sprite.py +++ b/tools/compile_npc_sprite.py @@ -46,9 +46,9 @@ if __name__ == "__main__": f.write(offset.to_bytes(4, byteorder="big")) f.write((len(comp.commands) * 2).to_bytes(2, byteorder="big")) - f.write(comp.x.to_bytes(2, byteorder="big")) - f.write(comp.y.to_bytes(2, byteorder="big")) - f.write(comp.z.to_bytes(2, byteorder="big")) + f.write(comp.x.to_bytes(2, byteorder="big", signed=True)) + f.write(comp.y.to_bytes(2, byteorder="big", signed=True)) + f.write(comp.z.to_bytes(2, byteorder="big", signed=True)) next_anim = f.tell() diff --git a/tools/splat_ext/PaperMarioNpcSprites.py b/tools/splat_ext/PaperMarioNpcSprites.py index 5242e84213..cd7be31575 100644 --- a/tools/splat_ext/PaperMarioNpcSprites.py +++ b/tools/splat_ext/PaperMarioNpcSprites.py @@ -241,9 +241,9 @@ class Component: commands_data = sprite_data[commands_offset : commands_offset + commands_size] self.commands = [int.from_bytes(d[0:2], byteorder="big") for d in iter_in_groups(commands_data, 2)] - self.x = int.from_bytes(data[6:8], byteorder="big") - self.y = int.from_bytes(data[8:10], byteorder="big") - self.z = int.from_bytes(data[10:12], byteorder="big") + self.x = int.from_bytes(data[6:8], byteorder="big", signed=True) + self.y = int.from_bytes(data[8:10], byteorder="big", signed=True) + self.z = int.from_bytes(data[10:12], byteorder="big", signed=True) return self