comparison pytouhou/ui/gamerunner.pyx @ 538:1abb6f7db8cc

Don’t retrieve the keyboard_state pointer at each frame.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 24 Apr 2014 20:01:42 +0200
parents 7c3c90468996
children 56bca8ce4b68
comparison
equal deleted inserted replaced
537:63440d1e0717 538:1abb6f7db8cc
127 self.set_renderer_size(event[2], event[3]) 127 self.set_renderer_size(event[2], event[3])
128 if self.window is not None: 128 if self.window is not None:
129 self.window.set_size(event[2], event[3]) 129 self.window.set_size(event[2], event[3])
130 if self.replay_level is None: 130 if self.replay_level is None:
131 #TODO: allow user settings 131 #TODO: allow user settings
132 keys = sdl.get_keyboard_state() 132 keys = sdl.keyboard_state
133 keystate = 0 133 keystate = 0
134 if keys[sdl.SCANCODE_Z]: 134 if keys[sdl.SCANCODE_Z]:
135 keystate |= 1 135 keystate |= 1
136 if keys[sdl.SCANCODE_X]: 136 if keys[sdl.SCANCODE_X]:
137 keystate |= 2 137 keystate |= 2