1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-01-04 22:30:18 +00:00

Remove arbitrary counter and allow escape to exit

This commit is contained in:
Peter Evans 2018-01-23 15:04:11 -06:00
parent 775a145480
commit 8f516db42b

View File

@ -169,7 +169,6 @@ vm_screen_active(vm_screen *screen)
{ {
SDL_Event event; SDL_Event event;
char ch; char ch;
static int counter = 300000;
// There may be _many_ events in the queue; for example, you may be // There may be _many_ events in the queue; for example, you may be
// facerolling on Zork because it feels good. And good for you if // facerolling on Zork because it feels good. And good for you if
@ -202,18 +201,18 @@ vm_screen_active(vm_screen *screen)
case SDL_KEYUP: case SDL_KEYUP:
// Note we do not erase the last_key value. // Note we do not erase the last_key value.
screen->key_pressed = false; screen->key_pressed = false;
if (ch == SDLK_ESCAPE) {
return false;
}
break; break;
} }
} }
if (counter--) {
return true; return true;
} }
SDL_Delay(2000);
return false;
}
/* /*
* Do whatever is required to refresh the screen with the changes we've * Do whatever is required to refresh the screen with the changes we've
* made recently. * made recently.