changeset 238:0e1762b1ab9f

Fix ANM interrupts
author Thibaut Girka <thib@sitedethib.com>
date Sun, 01 Jan 2012 20:23:00 +0100
parents cbe9dbd80dfb
children 901489c21d19
files anmviewer pytouhou/ui/anmrenderer.py pytouhou/vm/anmrunner.py
diffstat 3 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
old mode 100644
new mode 100755
--- a/pytouhou/ui/anmrenderer.py
+++ b/pytouhou/ui/anmrenderer.py
@@ -116,8 +116,10 @@ class ANMRenderer(pyglet.window.Window, 
         elif symbol == pyglet.window.key.TAB:
             self.toggle_sprites()
         elif symbol >= pyglet.window.key.F1 and symbol <= pyglet.window.key.F12:
-            print (symbol - pyglet.window.key.F1 + (12 if modifiers == pyglet.window.key.MOD_CTRL else 0) + 1)
-            #self._anmrunner.interrupt(symbol - pyglet.window.key.F1 + (12 if modifiers == pyglet.window.key.MOD_CTRL) + 1)
+            interrupt = symbol - pyglet.window.key.F1 + 1
+            if modifiers == pyglet.window.key.MOD_CTRL:
+                interrupt += 12
+            self._anmrunner.interrupt(interrupt)
 
 
     def load(self, index=None):
--- a/pytouhou/vm/anmrunner.py
+++ b/pytouhou/vm/anmrunner.py
@@ -51,6 +51,7 @@ class ANMRunner(object):
         else:
             self.instruction_pointer = new_ip
             self.frame, opcode, args = self.script[self.instruction_pointer]
+            self.waiting = False
             return True