Browse Source

fixed game loop handling if menu support is disabled

feature/2015
Christian Kroll 14 years ago
parent
commit
c1b55278cd
  1. 58
      display_loop.c

58
display_loop.c

@ -199,7 +199,6 @@ void display_loop(){
menu(); menu();
mode = oldOldmode; mode = oldOldmode;
#else #else
#ifdef GAME_TETRIS
case 42: case 42:
if (JOYISFIRE) if (JOYISFIRE)
mode = 43; mode = 43;
@ -208,64 +207,39 @@ void display_loop(){
break; break;
case 43: case 43:
waitForFire = 0; waitForFire = 0; // avoid circular jumps
while (JOYISFIRE); while (JOYISFIRE); // wait until user released the fire button
wait(25); // wait for button to settle
#ifdef GAME_TETRIS
tetris(); tetris();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif #endif
#ifdef GAME_BASTET #ifdef GAME_BASTET
case 44:
waitForFire = 0;
while (JOYISFIRE);
tetris_bastet(); tetris_bastet();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif #endif
#ifdef GAME_TETRIS_FP #ifdef GAME_TETRIS_FP
case 45:
waitForFire = 0;
while (JOYISFIRE);
tetris_fp(); tetris_fp();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif #endif
#ifdef GAME_SPACE_INVADERS #ifdef GAME_SPACE_INVADERS
case 45:
waitForFire = 0;
while (JOYISFIRE);
borg_invaders(); borg_invaders();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif #endif
#ifdef GAME_SNAKE #ifdef GAME_SNAKE
case 46:
waitForFire = 0;
while (JOYISFIRE);
snake_game(); snake_game();
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif #endif
#ifdef GAME_BREAKOUT #ifdef GAME_BREAKOUT
case 47:
waitForFire = 0;
while (JOYISFIRE);
borg_breakout(0); borg_breakout(0);
while (JOYISFIRE);
mode = oldOldmode;
waitForFire = 1;
break;
#endif #endif
while (JOYISFIRE); // avoid an unwanted restart of the game loop
wait(25); // wait for button to settle
mode = oldOldmode; // restore old animation mode
waitForFire = 1; // reenable joystick query of the wait() function
break;
#endif #endif
#ifdef ANIMATION_OFF #ifdef ANIMATION_OFF

Loading…
Cancel
Save