comparison pytouhou/formats/anm0.py @ 300:da53bc29b94a

Add the game interface.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 10 Mar 2012 17:47:03 +0100
parents dbb1a86c0235
children 70e2ed71b09c
comparison
equal deleted inserted replaced
299:e04e402e6380 300:da53bc29b94a
78 78
79 79
80 @classmethod 80 @classmethod
81 def read(cls, file): 81 def read(cls, file):
82 nb_sprites, nb_scripts, zero1 = unpack('<III', file.read(12)) 82 nb_sprites, nb_scripts, zero1 = unpack('<III', file.read(12))
83 width, height, format, zero2 = unpack('<IIII', file.read(16)) 83 width, height, format, unknown1 = unpack('<IIII', file.read(16))
84 first_name_offset, unused, secondary_name_offset = unpack('<III', file.read(12)) 84 first_name_offset, unused, secondary_name_offset = unpack('<III', file.read(12))
85 version, unknown1, thtxoffset, hasdata, nextoffset, zero3 = unpack('<IIIIII', file.read(24)) 85 version, unknown2, thtxoffset, hasdata, nextoffset, zero2 = unpack('<IIIIII', file.read(24))
86 if version != 0: 86 if version != 0:
87 raise Exception #TODO 87 raise Exception #TODO
88 if (zero1, zero2, zero3) != (0, 0, 0): 88 if (zero1, zero2) != (0, 0):
89 raise Exception #TODO 89 raise Exception #TODO
90 90
91 sprite_offsets = [unpack('<I', file.read(4))[0] for i in range(nb_sprites)] 91 sprite_offsets = [unpack('<I', file.read(4))[0] for i in range(nb_sprites)]
92 script_offsets = [unpack('<II', file.read(8)) for i in range(nb_scripts)] 92 script_offsets = [unpack('<II', file.read(8)) for i in range(nb_scripts)]
93 93