comparison pytouhou/formats/anm0.py @ 57:694f25881d0f

Fix move_to interpolation, add support for a few ANM and ECL instructions
author Thibaut Girka <thib@sitedethib.com>
date Tue, 23 Aug 2011 19:27:24 +0200
parents ab826bc29aa2
children a142e57218a0
comparison
equal deleted inserted replaced
56:299de3a9b69f 57:694f25881d0f
77 args = unpack('<I', data) 77 args = unpack('<I', data)
78 elif instr_type == 2: # set_scale 78 elif instr_type == 2: # set_scale
79 args = unpack('<ff', data) 79 args = unpack('<ff', data)
80 elif instr_type == 3: # set_alpha 80 elif instr_type == 3: # set_alpha
81 args = unpack('<I', data) 81 args = unpack('<I', data)
82 elif instr_type == 4: # set_color
83 args = unpack('<BBBx', data)
82 elif instr_type == 5: # jump 84 elif instr_type == 5: # jump
83 # Translate offset to instruction index 85 # Translate offset to instruction index
84 args = (instruction_offsets.index(unpack('<I', data)[0]),) 86 args = (instruction_offsets.index(unpack('<I', data)[0]),)
85 elif instr_type == 9: # set_3d_rotation 87 elif instr_type == 9: # set_3d_rotation
86 args = unpack('<fff', data) 88 args = unpack('<fff', data)
87 elif instr_type == 10: # set_3d_rotation_speed 89 elif instr_type == 10: # set_3d_rotation_speed
88 args = unpack('<fff', data) 90 args = unpack('<fff', data)
91 elif instr_type == 11: # set_scale_speed
92 args = unpack('<ff', data)
93 elif instr_type == 12: # fade
94 args = unpack('<ii', data)
95 elif instr_type == 16: # set_random_sprite
96 args = unpack('<ii', data)
89 elif instr_type == 27: # shift_texture_x 97 elif instr_type == 27: # shift_texture_x
90 args = unpack('<f', data) 98 args = unpack('<f', data)
91 elif instr_type == 28: # shift_texture_y 99 elif instr_type == 28: # shift_texture_y
92 args = unpack('<f', data) 100 args = unpack('<f', data)
101 elif instr_type == 30: # scale_in
102 args = unpack('<ffi', data)
93 else: 103 else:
94 args = (data,) 104 args = (data,)
95 anm.scripts[i].append((time, instr_type, args)) 105 anm.scripts[i].append((time, instr_type, args))
96 if instr_type == 0: 106 if instr_type == 0:
97 break 107 break