# HG changeset patch # User Thibaut Girka # Date 1325445780 -3600 # Node ID 0e1762b1ab9f9b04cd033fa8906341095672ffcc # Parent cbe9dbd80dfb610f7ca127f80b15732541f9b5bf Fix ANM interrupts diff --git a/anmviewer b/anmviewer old mode 100644 new mode 100755 diff --git a/pytouhou/ui/anmrenderer.py b/pytouhou/ui/anmrenderer.py --- 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): diff --git a/pytouhou/vm/anmrunner.py b/pytouhou/vm/anmrunner.py --- 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