fix sprite component xyz signedness

This commit is contained in:
Alex Bates 2020-12-21 23:46:14 +00:00
parent 95916b0c8b
commit 09e7228e1d
2 changed files with 6 additions and 6 deletions

View File

@ -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()

View File

@ -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