diff examples/tank/tank_main.c @ 153:9870b049b7f6

Make mb_progm_abort() work.
author Thinker K.F. Li <thinker@branda.to>
date Sat, 27 Sep 2008 02:40:42 +0800
parents c65b30e2eda9
children 6ce68c1f7405
line wrap: on
line diff
--- a/examples/tank/tank_main.c	Fri Sep 26 17:56:08 2008 +0800
+++ b/examples/tank/tank_main.c	Sat Sep 27 02:40:42 2008 +0800
@@ -108,7 +108,7 @@
 
     if(tank->progm) {
 	tman = X_MB_tman(xmb_rt);
-	mb_progm_abort(tank->progm, tman);
+	mb_progm_abort(tank->progm);
     }
     free(tank);
 }
@@ -252,27 +252,31 @@
     switch(xkey->sym) {
     case 0xff51:		/* left */
 	direction = TD_LEFT;
+	tank_move(tank_rt->tank1, direction, tank_rt);
 	break;
 
     case 0xff52:		/* up */
 	direction = TD_UP;
+	tank_move(tank_rt->tank1, direction, tank_rt);
 	break;
 
     case 0xff53:		/* right */
 	direction = TD_RIGHT;
+	tank_move(tank_rt->tank1, direction, tank_rt);
 	break;
 
     case 0xff54:		/* down */
 	direction = TD_DOWN;
+	tank_move(tank_rt->tank1, direction, tank_rt);
 	break;
 
     case 0x20:			/* space */
+	break;
     case 0xff0d:		/* enter */
     default:
 	return;
     }
 
-    tank_move(tank_rt->tank1, direction, tank_rt);
 }
 
 static void init_keyboard(tank_rt_t *tank_rt) {