annotate pytouhou/game/sprite.pxd @ 529:bd0c15d28dd6

Always verify chunks are not None before using them, fix crash when audio is disabled.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 23 Mar 2014 10:51:19 +0100
parents 0b2a92a25245
children dacdcca59b66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
439
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
1 from pytouhou.utils.interpolator cimport Interpolator
525
43ecf0f98f4d Precalculate the inverse of the texture size at ANM load, to not recalculate at every sprite change.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 467
diff changeset
2 from pytouhou.formats.anm0 cimport ANM
439
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
3
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
4 cdef class Sprite:
467
5bb7d2c0ff46 Fix lasers sprite handling
Thibaut Girka <thib@sitedethib.com>
parents: 439
diff changeset
5 cdef public long blendfunc, frame
5bb7d2c0ff46 Fix lasers sprite handling
Thibaut Girka <thib@sitedethib.com>
parents: 439
diff changeset
6 cdef public double width_override, height_override, angle
439
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
7 cdef public bint removed, changed, visible, force_rotation
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
8 cdef public bint automatic_orientation, allow_dest_offset, mirrored
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
9 cdef public bint corner_relative_placement
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
10 cdef public Interpolator scale_interpolator, fade_interpolator
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
11 cdef public Interpolator offset_interpolator, rotation_interpolator
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
12 cdef public Interpolator color_interpolator
525
43ecf0f98f4d Precalculate the inverse of the texture size at ANM load, to not recalculate at every sprite change.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 467
diff changeset
13 cdef public ANM anm
43ecf0f98f4d Precalculate the inverse of the texture size at ANM load, to not recalculate at every sprite change.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 467
diff changeset
14 cdef public object _rendering_data
439
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
15
526
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
16 cdef float _dest_offset[3]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
17 cdef double _texcoords[4]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
18 cdef double _texoffsets[2]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
19 cdef double _rescale[2]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
20 cdef double _scale_speed[2]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
21 cdef double _rotations_3d[3]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
22 cdef double _rotations_speed_3d[3]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
23 cdef unsigned char _color[4]
0b2a92a25245 Store data in C arrays in Sprite, and add an interface to access them as tuples.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 525
diff changeset
24
439
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
25 cpdef fade(self, unsigned long duration, alpha, formula=*)
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
26 cpdef scale_in(self, unsigned long duration, sx, sy, formula=*)
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
27 cpdef move_in(self, unsigned long duration, x, y, z, formula=*)
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
28 cpdef rotate_in(self, unsigned long duration, rx, ry, rz, formula=*)
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
29 cpdef change_color_in(self, unsigned long duration, r, g, b, formula=*)
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
30 cpdef update_orientation(self, double angle_base=*, bint force_rotation=*)
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
31 cpdef Sprite copy(self)
723a3e67a223 Make pytouhou.game.sprite an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
32 cpdef update(self)