Mercurial > touhou
changeset 540:53fa73932e9a
Fix warnings introduced in Cython 0.20, when more than one pointer is defined on the same line.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 10 May 2014 22:20:22 +0200 |
parents | d6d9a711253d |
children | 8895ede4e51e |
files | pytouhou/game/enemy.pyx pytouhou/game/laser.pxd pytouhou/game/laser.pyx pytouhou/game/text.pxd pytouhou/ui/opengl/gamerenderer.pxd pytouhou/ui/opengl/gamerenderer.pyx pytouhou/ui/opengl/renderer.pxd pytouhou/ui/opengl/sprite.pxd pytouhou/utils/interpolator.pxd pytouhou/utils/lzss.pyx |
diffstat | 10 files changed, 26 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/pytouhou/game/enemy.pyx +++ b/pytouhou/game/enemy.pyx @@ -334,7 +334,8 @@ cdef class Enemy(Element): cdef Player player cdef PlayerLaser laser cdef long damages - cdef double half_size[2], phalf_size + cdef double half_size[2] + cdef double phalf_size # Check for collisions ex, ey = self.x, self.y
--- a/pytouhou/game/laser.pxd +++ b/pytouhou/game/laser.pxd @@ -18,7 +18,8 @@ cdef class Laser(Element): cdef unsigned long start_duration, duration, stop_duration, grazing_delay, cdef unsigned long grazing_extra_duration, sprite_idx_offset - cdef double base_pos[2], speed, start_offset, end_offset, max_length, width + cdef double base_pos[2] + cdef double speed, start_offset, end_offset, max_length, width cdef State state cdef LaserType _laser_type @@ -33,7 +34,8 @@ cdef class Laser(Element): cdef class PlayerLaser(Element): - cdef double hitbox[2], angle, offset + cdef double hitbox[2] + cdef double angle, offset cdef unsigned long frame, duration, sprite_idx_offset, damage cdef Element origin cdef LaserType _laser_type
--- a/pytouhou/game/laser.pyx +++ b/pytouhou/game/laser.pyx @@ -101,7 +101,9 @@ cdef class Laser(Element): cdef bint _check_collision(self, double point[2], double border_size): - cdef double c1[2], c2[2], c3[2] + cdef double c1[2] + cdef double c2[2] + cdef double c3[2] x, y = point[0] - self.base_pos[0], point[1] - self.base_pos[1] dx, dy = cos(self.angle), sin(self.angle)
--- a/pytouhou/game/text.pxd +++ b/pytouhou/game/text.pxd @@ -65,7 +65,8 @@ cdef class NativeText(Element): cdef bint shadow cdef bytes align #TODO: use a proper enum. cdef unsigned long frame, timeout, duration, start - cdef double to[2], end[2] + cdef double to[2] + cdef double end[2] cdef list gradient cdef Interpolator fade_interpolator, offset_interpolator cdef object texture
--- a/pytouhou/ui/opengl/gamerenderer.pxd +++ b/pytouhou/ui/opengl/gamerenderer.pxd @@ -5,7 +5,9 @@ from .renderer cimport Renderer, Framebu from .shader cimport Shader cdef class GameRenderer(Renderer): - cdef Matrix *game_mvp, *interface_mvp, *proj + cdef Matrix *game_mvp + cdef Matrix *interface_mvp + cdef Matrix *proj cdef Shader game_shader, background_shader, interface_shader, passthrough_shader cdef Framebuffer framebuffer cdef BackgroundRenderer background_renderer
--- a/pytouhou/ui/opengl/gamerenderer.pyx +++ b/pytouhou/ui/opengl/gamerenderer.pyx @@ -101,7 +101,9 @@ cdef class GameRenderer(Renderer): cdef void render_game(self, Game game): cdef long game_x, game_y - cdef float x, y, z, dx, dy, dz, fog_data[4], fog_start, fog_end + cdef float x, y, z, dx, dy, dz + cdef float fog_data[4] + cdef float fog_start, fog_end cdef unsigned char fog_r, fog_g, fog_b cdef Matrix *mvp
--- a/pytouhou/ui/opengl/renderer.pxd +++ b/pytouhou/ui/opengl/renderer.pxd @@ -15,7 +15,8 @@ cdef struct PassthroughVertex: cdef class Texture: cdef long key - cdef GLuint texture, *pointer + cdef GLuint texture + cdef GLuint *pointer cdef unsigned short indices[2][65536] #XXX: keep a reference so that when __dealloc__ is called self.pointer is still valid.
--- a/pytouhou/ui/opengl/sprite.pxd +++ b/pytouhou/ui/opengl/sprite.pxd @@ -1,7 +1,8 @@ from pytouhou.game.sprite cimport Sprite cdef struct RenderingData: - float pos[12], left, right, bottom, top + float pos[12] + float left, right, bottom, top unsigned char color[4] long key
--- a/pytouhou/utils/interpolator.pxd +++ b/pytouhou/utils/interpolator.pxd @@ -1,7 +1,9 @@ cdef class Interpolator: cdef unsigned long start_frame, end_frame, _frame cdef long _length - cdef double *_values, *start_values, *end_values + cdef double *_values + cdef double *start_values + cdef double *end_values cdef object _formula cpdef set_interpolation_start(self, unsigned long frame, tuple values)
--- a/pytouhou/utils/lzss.pyx +++ b/pytouhou/utils/lzss.pyx @@ -28,7 +28,8 @@ cpdef bytes decompress(BitStream bitstre cdef Py_ssize_t ptr, length cdef unsigned int dictionary_head cdef unsigned char byte - cdef char *out_data, *dictionary + cdef char *out_data + cdef char *dictionary out_data = <char*> malloc(size) dictionary = <char*> calloc(dictionary_size, 1)