[AD] minor change to exquat

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


The patch makes exquat react to a keypress as soon as it happens, not after the interpolation animation is completed (which can be a bit frustrating).

Peter
Index: examples/exquat.c
===================================================================
RCS file: /cvsroot/alleg/allegro/examples/exquat.c,v
retrieving revision 1.11
diff -u -r1.11 exquat.c
--- examples/exquat.c	14 Jun 2003 09:48:06 -0000	1.11
+++ examples/exquat.c	31 Jul 2004 03:17:42 -0000
@@ -317,7 +317,9 @@
    for (;;) {
       float t;
 
-      for (index=0; index<(NUM_STEPS+1); index++) {
+      clear_keybuf();
+
+      for (index=0; !keypressed() && index<(NUM_STEPS+1); index++) {
 	 t = index * (1.0 / NUM_STEPS);
 
 	 /* the first part shows how to animate the cube incorrectly


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/