mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 20:42:41 +01:00
fix sprite component xyz signedness
This commit is contained in:
parent
95916b0c8b
commit
09e7228e1d
@ -46,9 +46,9 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
f.write(offset.to_bytes(4, byteorder="big"))
|
f.write(offset.to_bytes(4, byteorder="big"))
|
||||||
f.write((len(comp.commands) * 2).to_bytes(2, 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.x.to_bytes(2, byteorder="big", signed=True))
|
||||||
f.write(comp.y.to_bytes(2, byteorder="big"))
|
f.write(comp.y.to_bytes(2, byteorder="big", signed=True))
|
||||||
f.write(comp.z.to_bytes(2, byteorder="big"))
|
f.write(comp.z.to_bytes(2, byteorder="big", signed=True))
|
||||||
|
|
||||||
next_anim = f.tell()
|
next_anim = f.tell()
|
||||||
|
|
||||||
|
@ -241,9 +241,9 @@ class Component:
|
|||||||
commands_data = sprite_data[commands_offset : commands_offset + commands_size]
|
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.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.x = int.from_bytes(data[6:8], byteorder="big", signed=True)
|
||||||
self.y = int.from_bytes(data[8:10], byteorder="big")
|
self.y = int.from_bytes(data[8:10], byteorder="big", signed=True)
|
||||||
self.z = int.from_bytes(data[10:12], byteorder="big")
|
self.z = int.from_bytes(data[10:12], byteorder="big", signed=True)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user