Added _quitFlag test to Kyra 2 animation and to waitForEvent().

svn-id: r23617
This commit is contained in:
Torbjörn Andersson 2006-07-29 05:59:44 +00:00
parent f8d4994dc2
commit f51fc44e66
2 changed files with 6 additions and 6 deletions

View File

@ -652,7 +652,7 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
void KyraEngine::waitForEvent() { void KyraEngine::waitForEvent() {
bool finished = false; bool finished = false;
OSystem::Event event; OSystem::Event event;
while (!finished) { while (!finished && !_quitFlag) {
while (_system->pollEvent(event)) { while (_system->pollEvent(event)) {
switch (event.type) { switch (event.type) {
case OSystem::EVENT_KEYDOWN: case OSystem::EVENT_KEYDOWN:

View File

@ -46,7 +46,7 @@ int KyraEngine_v2::go() {
_screen->setScreenPalette(pal); _screen->setScreenPalette(pal);
title->setX(0); title->setY(0); title->setX(0); title->setY(0);
title->setDrawPage(0); title->setDrawPage(0);
for (int i = 0; i < 26; ++i) { for (int i = 0; i < 26 && !_quitFlag; ++i) {
uint32 nextRun = _system->getMillis() + 6 * _tickLength; uint32 nextRun = _system->getMillis() + 6 * _tickLength;
title->displayFrame(i); title->displayFrame(i);
_screen->updateScreen(); _screen->updateScreen();