changeset 617:a6af3ff86612

Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Mar 2015 00:08:20 +0100
parents 4ce3ef053a25
children 0ea591b0b29e
files pytouhou/game/bullet.pxd pytouhou/game/bullet.pyx pytouhou/game/enemy.pxd pytouhou/game/enemy.pyx pytouhou/game/game.pxd pytouhou/game/game.pyx pytouhou/game/item.pxd pytouhou/game/item.pyx pytouhou/game/laser.pxd pytouhou/game/laser.pyx pytouhou/game/player.pxd pytouhou/game/player.pyx pytouhou/game/text.pxd pytouhou/lib/sdl.pxd pytouhou/lib/sdl.pyx pytouhou/ui/gamerunner.pyx pytouhou/ui/opengl/backend.pyx pytouhou/ui/opengl/background.pxd pytouhou/ui/opengl/background.pyx pytouhou/ui/opengl/framebuffer.pxd pytouhou/ui/opengl/framebuffer.pyx pytouhou/ui/opengl/gamerenderer.pxd pytouhou/ui/opengl/gamerenderer.pyx pytouhou/ui/opengl/renderer.pxd pytouhou/ui/opengl/renderer.pyx pytouhou/ui/opengl/shader.pxd pytouhou/ui/opengl/shader.pyx pytouhou/ui/opengl/texture.pxd pytouhou/ui/opengl/texture.pyx pytouhou/ui/sdl/gamerenderer.pxd pytouhou/ui/sdl/texture.pxd pytouhou/ui/sdl/texture.pyx pytouhou/ui/window.pxd pytouhou/ui/window.pyx
diffstat 34 files changed, 138 insertions(+), 138 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/bullet.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/bullet.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -24,7 +24,7 @@
 
     cdef bint is_visible(self, unsigned int screen_width, unsigned int screen_height) nogil
     cpdef set_anim(self, sprite_idx_offset=*)
-    cdef void launch(self) except *
-    cdef void collide(self) except *
-    cdef void cancel(self) except *
-    cdef void update(self) except *
+    cdef bint launch(self) except True
+    cdef bint collide(self) except True
+    cdef bint cancel(self) except True
+    cdef bint update(self) except True
--- a/pytouhou/game/bullet.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/bullet.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -110,7 +110,7 @@
                                    self.sprite, self.sprite_idx_offset)
 
 
-    cdef void launch(self) except *:
+    cdef bint launch(self) except True:
         self.state = LAUNCHED
         self.frame = 0
         self.set_anim()
@@ -121,13 +121,13 @@
                                                    (self.speed,), 16)
 
 
-    cdef void collide(self) except *:
+    cdef bint collide(self) except True:
         self.cancel()
         self._game.new_particle((self.x, self.y), 10, 256) #TODO: find the real size.
 
 
     @cython.cdivision(True)
-    cdef void cancel(self) except *:
+    cdef bint cancel(self) except True:
         # Cancel animation
         bt = self._bullet_type
         self.sprite = Sprite()
@@ -145,7 +145,7 @@
         self.state = CANCELLED
 
 
-    cdef void update(self) except *:
+    cdef bint update(self) except True:
         cdef int frame, count, game_width, game_height
         cdef double length, angle, speed, acceleration, angular_speed
 
--- a/pytouhou/game/enemy.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/enemy.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -41,14 +41,14 @@
     cpdef Player select_player(self, list players=*)
     cpdef double get_angle(self, Element target, tuple pos=*) except 42
     cpdef set_anim(self, index)
-    cdef void die_anim(self) except *
-    cdef void drop_particles(self, long number, long color) except *
+    cdef bint die_anim(self) except True
+    cdef bint drop_particles(self, long number, long color) except True
     cpdef set_aux_anm(self, long number, long index)
     cpdef set_pos(self, double x, double y, double z)
     cpdef move_to(self, unsigned long duration, double x, double y, double z, formula)
     cpdef stop_in(self, unsigned long duration, formula)
     cpdef set_boss(self, bint enable)
     cdef bint is_visible(self, long screen_width, long screen_height) except -1
-    cdef void check_collisions(self) except *
-    cdef void handle_callbacks(self) except *
-    cdef void update(self) except *
+    cdef bint check_collisions(self) except True
+    cdef bint handle_callbacks(self) except True
+    cdef bint update(self) except True
--- a/pytouhou/game/enemy.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/enemy.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -261,13 +261,13 @@
         self.anmrunner = ANMRunner(self._anms[entry], index, self.sprite)
 
 
-    cdef void die_anim(self) except *:
+    cdef bint die_anim(self) except True:
         anim = {0: 3, 1: 4, 2: 5}[self.death_anim % 256] # The TB is wanted, if index isn’t in these values the original game crashs.
         self._game.new_effect((self.x, self.y), anim)
         self._game.sfx_player.play('enep00.wav')
 
 
-    cdef void drop_particles(self, long number, long color) except *:
+    cdef bint drop_particles(self, long number, long color) except True:
         if color == 0:
             if self._game.stage in [1, 2, 7]:
                 color = 3
@@ -338,7 +338,7 @@
         return True
 
 
-    cdef void check_collisions(self) except *:
+    cdef bint check_collisions(self) except True:
         cdef Bullet bullet
         cdef Player player
         cdef PlayerLaser laser
@@ -426,7 +426,7 @@
             self.life -= damages
 
 
-    cdef void handle_callbacks(self) except *:
+    cdef bint handle_callbacks(self) except True:
         #TODO: implement missing callbacks and clean up!
         if self.life <= 0 and self.touchable:
             self.timeout = -1 #TODO: not really true, the timeout is frozen
@@ -459,7 +459,7 @@
 
                 if death_flags == 0:
                     self.removed = True
-                    return
+                    return False
 
                 if death_flags == 1:
                     if self.boss:
@@ -502,7 +502,7 @@
                 raise Exception('What the hell, man!')
 
 
-    cdef void update(self) except *:
+    cdef bint update(self) except True:
         cdef double x, y, speed
 
         if self.process is not None:
--- a/pytouhou/game/game.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/game.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -25,12 +25,12 @@
     cdef void modify_difficulty(self, long diff) nogil
     cpdef enable_spellcard_effect(self)
     cpdef disable_spellcard_effect(self)
-    cdef void set_player_bomb(self) except *
-    cdef void unset_player_bomb(self) except *
+    cdef bint set_player_bomb(self) except True
+    cdef bint unset_player_bomb(self) except True
     cpdef drop_bonus(self, double x, double y, long _type, end_pos=*, player=*)
-    cdef void autocollect(self, Player player) except *
-    cdef void cancel_bullets(self) except *
-    cdef void cancel_player_lasers(self) except *
+    cdef bint autocollect(self, Player player) except True
+    cdef bint cancel_bullets(self) except True
+    cdef bint cancel_player_lasers(self) except True
     cpdef change_bullets_into_star_items(self)
     cpdef change_bullets_into_bonus(self)
     cpdef kill_enemies(self)
@@ -43,12 +43,12 @@
     cpdef Text new_hint(self, hint)
     cpdef new_face(self, side, effect)
     cpdef run_iter(self, list keystates)
-    cdef void update_background(self) except *
-    cdef void update_enemies(self) except *
-    cdef void update_msg(self, long keystate) except *
-    cdef void update_players(self, list keystates) except *
-    cdef void update_effects(self) except *
-    cdef void update_hints(self) except *
-    cdef void update_faces(self) except *
-    cdef void update_bullets(self) except *
+    cdef bint update_background(self) except True
+    cdef bint update_enemies(self) except True
+    cdef bint update_msg(self, long keystate) except True
+    cdef bint update_players(self, list keystates) except True
+    cdef bint update_effects(self) except True
+    cdef bint update_hints(self) except True
+    cdef bint update_faces(self) except True
+    cdef bint update_bullets(self) except True
     cpdef cleanup(self)
--- a/pytouhou/game/game.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/game.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -119,14 +119,14 @@
             del self.texts['enemy_spellcard']
 
 
-    cdef void set_player_bomb(self) except *:
+    cdef bint set_player_bomb(self) except True:
         face = Effect((-32, -16), 1, self.msg_anm[0][0][0])
         face.sprite.allow_dest_offset = True
         self.effects.append(face)
         self.texts['player_spellcard'] = self.new_native_text((24, 24), u'Player Spellcard')
 
 
-    cdef void unset_player_bomb(self) except *:
+    cdef bint unset_player_bomb(self) except True:
         del self.texts['player_spellcard']
 
 
@@ -140,14 +140,14 @@
                                player=player))
 
 
-    cdef void autocollect(self, Player player) except *:
+    cdef bint autocollect(self, Player player) except True:
         cdef Item item
 
         for item in self.items:
             item.autocollect(player)
 
 
-    cdef void cancel_bullets(self) except *:
+    cdef bint cancel_bullets(self) except True:
         cdef Bullet bullet
         cdef Laser laser
 
@@ -156,7 +156,7 @@
         for laser in self.lasers:
             laser.cancel()
 
-    cdef void cancel_player_lasers(self) except *:
+    cdef bint cancel_player_lasers(self) except True:
         cdef PlayerLaser laser
         for laser in self.players_lasers:
             if laser is not None:
@@ -319,22 +319,22 @@
         self.frame += 1
 
 
-    cdef void update_background(self) except *:
+    cdef bint update_background(self) except True:
         if self.time_stop:
-            return
+            return False
         if self.spellcard_effect is not None:
             self.spellcard_effect.update()
         #TODO: update the actual background here?
 
 
-    cdef void update_enemies(self) except *:
+    cdef bint update_enemies(self) except True:
         cdef Enemy enemy
 
         for enemy in self.enemies:
             enemy.update()
 
 
-    cdef void update_msg(self, long keystate) except *:
+    cdef bint update_msg(self, long keystate) except True:
         cdef long k
 
         for k in (1, 256):
@@ -346,13 +346,13 @@
         self.msg_runner.run_iteration()
 
 
-    cdef void update_players(self, list keystates) except *:
+    cdef bint update_players(self, list keystates) except True:
         cdef Bullet bullet
         cdef Player player
         cdef long keystate
 
         if self.time_stop:
-            return
+            return False
 
         for bullet in self.players_bullets:
             bullet.update()
@@ -373,26 +373,26 @@
                         player.play_sound('extend')
 
 
-    cdef void update_effects(self) except *:
+    cdef bint update_effects(self) except True:
         cdef Element effect
 
         for effect in self.effects:
             effect.update()
 
 
-    cdef void update_hints(self) except *:
+    cdef bint update_hints(self) except True:
         for hint in self.hints:
             if hint['Count'] == self.frame and hint['Base'] == 'start':
                 self.new_hint(hint)
 
 
-    cdef void update_faces(self) except *:
+    cdef bint update_faces(self) except True:
         for face in self.faces:
             if face:
                 face.update()
 
 
-    cdef void update_bullets(self) except *:
+    cdef bint update_bullets(self) except True:
         cdef Player player
         cdef Bullet bullet
         cdef Item item
@@ -402,7 +402,7 @@
         cdef double player_pos[2]
 
         if self.time_stop:
-            return
+            return False
 
         for bullet in self.cancelled_bullets:
             bullet.update()
--- a/pytouhou/game/item.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/item.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -23,6 +23,6 @@
     cdef Indicator indicator
     cdef Interpolator speed_interpolator, pos_interpolator
 
-    cdef void autocollect(self, Player player) except *
-    cdef void on_collect(self, Player player) except *
+    cdef bint autocollect(self, Player player) except True
+    cdef bint on_collect(self, Player player) except True
     cpdef update(self)
--- a/pytouhou/game/item.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/item.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -74,17 +74,17 @@
             return [self]
 
 
-    cdef void autocollect(self, Player player) except *:
+    cdef bint autocollect(self, Player player) except True:
         if self.target is None and self.player is None:
             self.target = player
             self.speed = player.sht.autocollection_speed
 
 
-    cdef void on_collect(self, Player player) except *:
+    cdef bint on_collect(self, Player player) except True:
         cdef long level, poc
 
         if not (self.player is None or self.player is player):
-            return
+            return False
 
         old_power = player.power
         score = 0
--- a/pytouhou/game/laser.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/laser.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -23,7 +23,7 @@
     cdef State state
     cdef LaserType _laser_type
 
-    cdef void set_anim(self, long sprite_idx_offset=*) except *
+    cdef bint set_anim(self, long sprite_idx_offset=*) except True
     cpdef set_base_pos(self, double x, double y)
     cdef bint _check_collision(self, double point[2], double border_size)
     cdef bint check_collision(self, double point[2])
@@ -40,6 +40,6 @@
     cdef Element origin
     cdef LaserType _laser_type
 
-    cdef void set_anim(self, long sprite_idx_offset=*) except *
-    cdef void cancel(self) except *
-    cdef void update(self) except *
+    cdef bint set_anim(self, long sprite_idx_offset=*) except True
+    cdef bint cancel(self) except True
+    cdef bint update(self) except True
--- a/pytouhou/game/laser.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/laser.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -85,7 +85,7 @@
         self.set_anim()
 
 
-    cdef void set_anim(self, long sprite_idx_offset=-1) except *:
+    cdef bint set_anim(self, long sprite_idx_offset=-1) except True:
         if sprite_idx_offset >= 0:
             self.sprite_idx_offset = sprite_idx_offset
 
@@ -221,7 +221,7 @@
         self.set_anim()
 
 
-    cdef void set_anim(self, long sprite_idx_offset=-1) except *:
+    cdef bint set_anim(self, long sprite_idx_offset=-1) except True:
         if sprite_idx_offset >= 0:
             self.sprite_idx_offset = sprite_idx_offset
 
@@ -232,11 +232,11 @@
         #self.sprite.blendfunc = 1 #XXX
 
 
-    cdef void cancel(self) except *:
+    cdef bint cancel(self) except True:
         self.anmrunner.interrupt(1)
 
 
-    cdef void update(self) except *:
+    cdef bint update(self) except True:
         if self.anmrunner is not None and not self.anmrunner.run_frame():
             self.anmrunner = None
             self.removed = True
--- a/pytouhou/game/player.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/player.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -16,8 +16,8 @@
     cdef tuple speeds
     cdef long fire_time, bomb_time, direction
 
-    cdef void set_anim(self, index) except *
-    cdef void play_sound(self, str name) except *
-    cdef void collide(self) except *
-    cdef void fire(self) except *
+    cdef bint set_anim(self, index) except True
+    cdef bint play_sound(self, str name) except True
+    cdef bint collide(self) except True
+    cdef bint fire(self) except True
     cpdef update(self, long keystate)
--- a/pytouhou/game/player.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/player.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -68,16 +68,16 @@
         self.death_time = 0
 
 
-    cdef void set_anim(self, index) except *:
+    cdef bint set_anim(self, index) except True:
         self.sprite = Sprite()
         self.anmrunner = ANMRunner(self.anm, index, self.sprite)
 
 
-    cdef void play_sound(self, str name) except *:
+    cdef bint play_sound(self, str name) except True:
         self._game.sfx_player.play('%s.wav' % name)
 
 
-    cdef void collide(self) except *:
+    cdef bint collide(self) except True:
         if not self.invulnerable_time and not self.death_time and self.touchable: # Border Between Life and Death
             self.death_time = self._game.frame
             self._game.new_effect((self.x, self.y), 17)
@@ -95,7 +95,7 @@
         self.focused = False
 
 
-    cdef void fire(self) except *:
+    cdef bint fire(self) except True:
         cdef long shot_power
 
         sht = self.focused_sht if self.focused else self.sht
--- a/pytouhou/game/text.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/game/text.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -39,7 +39,7 @@
     #def timeout_update(self)
     #def move_timeout_update(self)
     #def fadeout_timeout_update(self)
-    cdef void fade(self, unsigned long duration, unsigned char alpha, formula=*) except *
+    cdef bint fade(self, unsigned long duration, unsigned char alpha, formula=*) except True
     cpdef set_timeout(self, unsigned long timeout, str effect=*, unsigned long duration=*, unsigned long start=*)
 
 
@@ -79,6 +79,6 @@
     #def move_ex_timeout_update(self)
     #def fadeout_timeout_update(self)
 
-    cdef void fade(self, unsigned long duration, unsigned char alpha, formula=*) except *
-    cdef void move_in(self, unsigned long duration, double x, double y, formula=*) except *
+    cdef bint fade(self, unsigned long duration, unsigned char alpha, formula=*) except True
+    cdef bint move_in(self, unsigned long duration, double x, double y, formula=*) except True
     cpdef set_timeout(self, unsigned long timeout, str effect=*, unsigned long duration=*, unsigned long start=*, to=*, end=*)
--- a/pytouhou/lib/sdl.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/lib/sdl.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -93,7 +93,7 @@
 cdef class Surface:
     cdef SDL_Surface *surface
 
-    cdef void blit(self, Surface other) except *
+    cdef bint blit(self, Surface other) except True
     cdef void set_alpha(self, Surface alpha_surface) nogil
 
 
@@ -117,17 +117,17 @@
     cdef Surface render(self, unicode text)
 
 
-cdef void init(Uint32 flags) except *
-cdef void img_init(int flags) except *
-cdef void mix_init(int flags) except *
-cdef void ttf_init() except *
-cdef void gl_set_attribute(SDL_GLattr attr, int value) except *
-cdef int gl_set_swap_interval(int interval) except *
+cdef bint init(Uint32 flags) except True
+cdef bint img_init(int flags) except True
+cdef bint mix_init(int flags) except True
+cdef bint ttf_init() except True
+cdef bint gl_set_attribute(SDL_GLattr attr, int value) except True
+cdef bint gl_set_swap_interval(int interval) except True
 cdef list poll_events()
 cdef Surface load_png(file_)
 cdef Surface create_rgb_surface(int width, int height, int depth, Uint32 rmask=*, Uint32 gmask=*, Uint32 bmask=*, Uint32 amask=*)
-cdef void mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except *
-cdef void mix_allocate_channels(int numchans) except *
+cdef bint mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except True
+cdef bint mix_allocate_channels(int numchans) except True
 cdef int mix_volume(int channel, float volume) nogil
 cdef int mix_volume_music(float volume) nogil
 cdef Music load_music(str filename)
--- a/pytouhou/lib/sdl.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/lib/sdl.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -204,7 +204,7 @@
         def __get__(self):
             return bytes(self.surface.pixels[:self.surface.w * self.surface.h * 4])
 
-    cdef void blit(self, Surface other) except *:
+    cdef bint blit(self, Surface other) except True:
         if SDL_BlitSurface(other.surface, NULL, self.surface, NULL) < 0:
             raise SDLError()
 
@@ -265,31 +265,31 @@
         return surface
 
 
-cdef void init(Uint32 flags) except *:
+cdef bint init(Uint32 flags) except True:
     if SDL_Init(flags) < 0:
         raise SDLError()
 
 
-cdef void img_init(int flags) except *:
+cdef bint img_init(int flags) except True:
     if IMG_Init(flags) != flags:
         raise SDLError()
 
 
-cdef void mix_init(int flags) except *:
+cdef bint mix_init(int flags) except True:
     if Mix_Init(flags) != flags:
         raise SDLError()
 
 
-cdef void ttf_init() except *:
+cdef bint ttf_init() except True:
     if TTF_Init() < 0:
         raise SDLError()
 
 
-cdef void gl_set_attribute(SDL_GLattr attr, int value) except *:
+cdef bint gl_set_attribute(SDL_GLattr attr, int value) except True:
     if SDL_GL_SetAttribute(attr, value) < 0:
         raise SDLError()
 
-cdef int gl_set_swap_interval(int interval) except *:
+cdef bint gl_set_swap_interval(int interval) except True:
     if SDL_GL_SetSwapInterval(interval) < 0:
         raise SDLError()
 
@@ -326,12 +326,12 @@
     return surface
 
 
-cdef void mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except *:
+cdef bint mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except True:
     if Mix_OpenAudio(frequency, format_, channels, chunksize) < 0:
         raise SDLError()
 
 
-cdef void mix_allocate_channels(int numchans) except *:
+cdef bint mix_allocate_channels(int numchans) except True:
     if Mix_AllocateChannels(numchans) != numchans:
         raise SDLError()
 
--- a/pytouhou/ui/gamerunner.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/gamerunner.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -76,7 +76,7 @@
         game.sfx_player = SFXPlayer(self.resource_loader) if not self.skip else null_player
 
 
-    cdef void set_input(self, replay=None) except *:
+    cdef bint set_input(self, replay=None) except True:
         if not replay or not replay.levels[self.game.stage-1]:
             self.replay_level = None
         else:
@@ -85,7 +85,7 @@
 
 
     @cython.cdivision(True)
-    cdef void set_renderer_size(self, long width, long height) except *:
+    cdef bint set_renderer_size(self, long width, long height) except True:
         if self.renderer is not None:
             runner_width = float(self.width)
             runner_height = float(self.height)
@@ -102,13 +102,13 @@
             self.renderer.size = x, y, new_width, new_height
 
 
-    cdef void start(self) except *:
+    cdef bint start(self) except True:
         if self.renderer is not None:
             self.set_renderer_size(self.width, self.height)
             self.renderer.start(self.common)
 
 
-    cdef void capture(self) except *:
+    cdef bint capture(self) except True:
         if self.renderer is not None:
             filename = 'screenshot/frame%06d.ppm' % self.game.frame
             self.renderer.capture(filename, self.width, self.height)
--- a/pytouhou/ui/opengl/backend.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/backend.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -46,7 +46,7 @@
     from pytouhou.ui.opengl.gamerenderer import GameRenderer
 
 
-cdef void discover_features() except *:
+cdef bint discover_features() except True:
     '''Discover which features are supported by our context.'''
 
     global use_debug_group, use_vao, use_primitive_restart, use_framebuffer_blit, use_pack_invert, use_scaled_rendering
--- a/pytouhou/ui/opengl/background.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/background.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -20,4 +20,4 @@
 
     cdef void set_state(self) nogil
     cdef void render_background(self) nogil
-    cdef void load(self, background, GLuint[MAX_TEXTURES] textures) except *
+    cdef bint load(self, background, GLuint[MAX_TEXTURES] textures) except True
--- a/pytouhou/ui/opengl/background.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/background.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -107,7 +107,7 @@
             glPopDebugGroup()
 
 
-    cdef void load(self, background, GLuint[MAX_TEXTURES] textures) except *:
+    cdef bint load(self, background, GLuint[MAX_TEXTURES] textures) except True:
         cdef float ox, oy, oz, ox2, oy2, oz2
         cdef GLsizei nb_vertices = 0, nb_indices = 0
 
--- a/pytouhou/ui/opengl/framebuffer.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/framebuffer.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -21,4 +21,4 @@
 
     cpdef bind(self)
     cdef void set_state(self) nogil
-    cdef void render(self, int x, int y, int width, int height) except *
+    cdef bint render(self, int x, int y, int width, int height) except True
--- a/pytouhou/ui/opengl/framebuffer.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/framebuffer.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -125,7 +125,7 @@
         glVertexAttribPointer(1, 2, GL_FLOAT, False, sizeof(PassthroughVertex), <void*>4)
         glEnableVertexAttribArray(1)
 
-    cdef void render(self, int x, int y, int width, int height) except *:
+    cdef bint render(self, int x, int y, int width, int height) except True:
         if use_debug_group:
             glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "Framebuffer drawing")
 
--- a/pytouhou/ui/opengl/gamerenderer.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/gamerenderer.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -14,6 +14,6 @@
     cdef BackgroundRenderer background_renderer
     cdef object background
 
-    cdef void render_game(self, Game game) except *
-    cdef void render_text(self, dict texts) except *
-    cdef void render_interface(self, interface, game_boss) except *
+    cdef bint render_game(self, Game game) except True
+    cdef bint render_text(self, dict texts) except True
+    cdef bint render_interface(self, interface, game_boss) except True
--- a/pytouhou/ui/opengl/gamerenderer.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/gamerenderer.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -121,7 +121,7 @@
         free(capture_memory)
 
 
-    cdef void render_game(self, Game game) except *:
+    cdef bint render_game(self, Game game) except True:
         cdef long game_x, game_y
         cdef float x, y, z, dx, dy, dz
         cdef float fog_data[4]
@@ -235,11 +235,11 @@
             glPopDebugGroup()
 
 
-    cdef void render_text(self, dict texts) except *:
+    cdef bint render_text(self, dict texts) except True:
         cdef NativeText label
 
         if self.font_manager is None:
-            return
+            return False
 
         self.font_manager.load(texts)
 
@@ -258,7 +258,7 @@
                 self.render_quads([rect], [gradient], texture)
 
 
-    cdef void render_interface(self, interface, game_boss) except *:
+    cdef bint render_interface(self, interface, game_boss) except True:
         cdef GlyphCollection label
 
         elements = []
--- a/pytouhou/ui/opengl/renderer.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/renderer.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -35,5 +35,5 @@
     cdef PyObject *elements[640*3]
 
     cdef void set_state(self) nogil
-    cdef void render_elements(self, elements) except *
-    cdef void render_quads(self, rects, colors, GLuint texture) except *
+    cdef bint render_elements(self, elements) except True
+    cdef bint render_quads(self, rects, colors, GLuint texture) except True
--- a/pytouhou/ui/opengl/renderer.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/renderer.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -130,12 +130,12 @@
         glBindBuffer(GL_ARRAY_BUFFER, 0)
 
 
-    cdef void render_elements(self, elements) except *:
+    cdef bint render_elements(self, elements) except True:
         cdef Element element
 
         nb_elements = find_objects(self, elements)
         if not nb_elements:
-            return
+            return False
 
         nb_vertices = 0
         memset(self.last_indices, 0, sizeof(self.last_indices))
@@ -232,7 +232,7 @@
             glPopDebugGroup()
 
 
-    cdef void render_quads(self, rects, colors, GLuint texture) except *:
+    cdef bint render_quads(self, rects, colors, GLuint texture) except True:
         # There is nothing that batch more than two quads on the same texture, currently.
         cdef Vertex buf[8]
         cdef unsigned short indices[12]
--- a/pytouhou/ui/opengl/shader.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/shader.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -6,10 +6,10 @@
     cdef bint linked
     cdef dict location_cache
 
-    cdef void create_shader(self, const GLchar *string, GLenum_shader shader_type) except *
-    cdef void link(self) except *
+    cdef bint create_shader(self, const GLchar *string, GLenum_shader shader_type) except True
+    cdef bint link(self) except True
     cdef GLint get_uniform_location(self, name) except -1
     cdef void bind(self) nogil
-    cdef void uniform_1(self, name, GLfloat val) except *
-    cdef void uniform_4(self, name, GLfloat a, GLfloat b, GLfloat c, GLfloat d) except *
-    cdef void uniform_matrix(self, name, Matrix *mat) except *
+    cdef bint uniform_1(self, name, GLfloat val) except True
+    cdef bint uniform_4(self, name, GLfloat a, GLfloat b, GLfloat c, GLfloat d) except True
+    cdef bint uniform_matrix(self, name, Matrix *mat) except True
--- a/pytouhou/ui/opengl/shader.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/shader.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -58,7 +58,7 @@
         if use_debug_group:
             glPopDebugGroup()
 
-    cdef void create_shader(self, const GLchar *string, GLenum_shader shader_type) except *:
+    cdef bint create_shader(self, const GLchar *string, GLenum_shader shader_type) except True:
         cdef GLint temp
         cdef const GLchar *strings[2]
         strings[:] = [shader_header, string]
@@ -91,7 +91,7 @@
             # all is well, so attach the shader to the program
             glAttachShader(self.handle, shader)
 
-    cdef void link(self) except *:
+    cdef bint link(self) except True:
         cdef GLint temp
 
         # link the program
@@ -132,11 +132,11 @@
 
     # upload a floating point uniform
     # this program must be currently bound
-    cdef void uniform_1(self, name, GLfloat val) except *:
+    cdef bint uniform_1(self, name, GLfloat val) except True:
         glUniform1fv(self.get_uniform_location(name), 1, &val)
 
     # upload a vec4 uniform
-    cdef void uniform_4(self, name, GLfloat a, GLfloat b, GLfloat c, GLfloat d) except *:
+    cdef bint uniform_4(self, name, GLfloat a, GLfloat b, GLfloat c, GLfloat d) except True:
         cdef GLfloat vals[4]
         vals[0] = a
         vals[1] = b
@@ -147,7 +147,7 @@
     # upload a uniform matrix
     # works with matrices stored as lists,
     # as well as euclid matrices
-    cdef void uniform_matrix(self, name, Matrix *mat) except *:
+    cdef bint uniform_matrix(self, name, Matrix *mat) except True:
         # obtain the uniform location
         loc = self.get_uniform_location(name)
         # uplaod the 4x4 floating point matrix
--- a/pytouhou/ui/opengl/texture.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/texture.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -3,10 +3,10 @@
 cdef class TextureManager:
     cdef object loader, renderer, texture_class
 
-    cdef void load(self, dict anms) except *
+    cdef bint load(self, dict anms) except True
 
 cdef class FontManager:
     cdef Font font
     cdef object renderer, texture_class
 
-    cdef void load(self, dict labels) except *
+    cdef bint load(self, dict labels) except True
--- a/pytouhou/ui/opengl/texture.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/opengl/texture.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -39,7 +39,7 @@
         self.texture_class = texture_class
 
 
-    cdef void load(self, dict anms) except *:
+    cdef bint load(self, dict anms) except True:
         if use_debug_group:
             glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "Texture loading")
 
@@ -73,7 +73,7 @@
         self.texture_class = texture_class
 
 
-    cdef void load(self, dict labels) except *:
+    cdef bint load(self, dict labels) except True:
         cdef NativeText label
 
         if use_debug_group:
--- a/pytouhou/ui/sdl/gamerenderer.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/sdl/gamerenderer.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -11,6 +11,6 @@
 
     cdef public size #XXX
 
-    cdef void render_game(self, Game game) except *
-    cdef void render_text(self, texts) except *
-    cdef void render_interface(self, interface, game_boss) except *
+    cdef bint render_game(self, Game game) except True
+    cdef bint render_text(self, texts) except True
+    cdef bint render_interface(self, interface, game_boss) except True
--- a/pytouhou/ui/sdl/texture.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/sdl/texture.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -5,11 +5,11 @@
     cdef object loader
     cdef Window window
 
-    cdef void load(self, dict anms) except *
+    cdef bint load(self, dict anms) except True
     cdef load_texture(self, Surface texture)
 
 cdef class FontManager:
     cdef Font font
     cdef Window window
 
-    cdef void load(self, dict labels) except *
+    cdef bint load(self, dict labels) except True
--- a/pytouhou/ui/sdl/texture.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/sdl/texture.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -28,7 +28,7 @@
         self.window = window
 
 
-    cdef void load(self, dict anms) except *:
+    cdef bint load(self, dict anms) except True:
         for anm in sorted(anms.values(), key=is_ascii):
             for entry in anm:
                 if entry.texture is None:
@@ -53,7 +53,7 @@
         self.window = window
 
 
-    cdef void load(self, dict labels) except *:
+    cdef bint load(self, dict labels) except True:
         cdef NativeText label
 
         for i, label in labels.items():
--- a/pytouhou/ui/window.pxd	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/window.pxd	Sun Mar 29 00:08:20 2015 +0100
@@ -7,14 +7,14 @@
     cdef double fps
 
     cdef void set_target_fps(self, long fps) nogil
-    cdef void tick(self) nogil except *
+    cdef bint tick(self) nogil except True
 
 
 cdef class Runner:
     cdef long width, height
 
-    cdef void start(self) except *
-    cdef void finish(self) except *
+    cdef bint start(self) except True
+    cdef bint finish(self) except True
     cpdef bint update(self, bint render) except -1
 
 
--- a/pytouhou/ui/window.pyx	Sat Mar 28 23:21:15 2015 +0100
+++ b/pytouhou/ui/window.pyx	Sun Mar 29 00:08:20 2015 +0100
@@ -33,7 +33,7 @@
 
 
     @cython.cdivision(True)
-    cdef void tick(self) nogil except *:
+    cdef bint tick(self) nogil except True:
         current = sdl.get_ticks()
 
         if not self._ref_tick:
@@ -65,10 +65,10 @@
 
 
 cdef class Runner:
-    cdef void start(self) except *:
+    cdef bint start(self) except True:
         pass
 
-    cdef void finish(self) except *:
+    cdef bint finish(self) except True:
         pass
 
     cpdef bint update(self, bint render) except -1: