[Scummvm-cvs-logs] SF.net SVN: scummvm:[34246] scummvm/trunk/engines/kyra

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Sep 1 19:52:52 CEST 2008


Revision: 34246
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34246&view=rev
Author:   fingolfin
Date:     2008-09-01 17:52:50 +0000 (Mon, 01 Sep 2008)

Log Message:
-----------
Merging more of the GSoC 2008 RTL branch: KYRA

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/detection.cpp
    scummvm/trunk/engines/kyra/gui.cpp
    scummvm/trunk/engines/kyra/gui_hof.cpp
    scummvm/trunk/engines/kyra/gui_lok.cpp
    scummvm/trunk/engines/kyra/gui_mr.cpp
    scummvm/trunk/engines/kyra/gui_v2.cpp
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_lok.cpp
    scummvm/trunk/engines/kyra/kyra_mr.cpp
    scummvm/trunk/engines/kyra/kyra_v1.cpp
    scummvm/trunk/engines/kyra/kyra_v1.h
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/saveload.cpp
    scummvm/trunk/engines/kyra/saveload_lok.cpp
    scummvm/trunk/engines/kyra/scene_hof.cpp
    scummvm/trunk/engines/kyra/scene_mr.cpp
    scummvm/trunk/engines/kyra/script_mr.cpp
    scummvm/trunk/engines/kyra/sequences_hof.cpp
    scummvm/trunk/engines/kyra/sequences_lok.cpp
    scummvm/trunk/engines/kyra/sprites.cpp
    scummvm/trunk/engines/kyra/staticres.cpp
    scummvm/trunk/engines/kyra/text.cpp
    scummvm/trunk/engines/kyra/text_hof.cpp
    scummvm/trunk/engines/kyra/text_lok.cpp
    scummvm/trunk/engines/kyra/text_mr.cpp
    scummvm/trunk/engines/kyra/vqa.cpp

Modified: scummvm/trunk/engines/kyra/detection.cpp
===================================================================
--- scummvm/trunk/engines/kyra/detection.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/detection.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -1064,11 +1064,19 @@
 		return "The Legend of Kyrandia (C) Westwood Studios";
 	}
 
-	bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
-
-	SaveStateList listSaves(const char *target) const;
+	virtual bool hasFeature(MetaEngineFeature f) const;
+	virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
+	virtual SaveStateList listSaves(const char *target) const;
 };
 
+bool KyraMetaEngine::hasFeature(MetaEngineFeature f) const {
+	return
+		(f == kSupportsRTL) ||
+		(f == kSupportsListSaves) ||
+		(f == kSupportsDirectLoad) ||
+		(f == kSupportsDeleteSave);
+}
+
 bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const KYRAGameDescription *gd = (const KYRAGameDescription *)desc;
 	bool res = true;

Modified: scummvm/trunk/engines/kyra/gui.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/gui.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -378,9 +378,6 @@
 
 	while (_system->getEventManager()->pollEvent(event)) {
 		switch (event.type) {
-		case Common::EVENT_QUIT:
-			_vm->quitGame();
-			break;
 		case Common::EVENT_LBUTTONUP:
 			return true;
 		default:

Modified: scummvm/trunk/engines/kyra/gui_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_hof.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/gui_hof.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -514,7 +514,7 @@
 
 	showBookPage();
 	_bookShown = true;
-	while (_bookShown && !_quitFlag) {
+	while (_bookShown && !quit()) {
 		checkInput(buttonList);
 		removeInputTop();
 

Modified: scummvm/trunk/engines/kyra/gui_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lok.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/gui_lok.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -34,7 +34,6 @@
 
 #include "common/config-manager.h"
 #include "common/savefile.h"
-#include "common/events.h"
 #include "common/system.h"
 
 #include "graphics/scaler.h"
@@ -471,7 +470,7 @@
 		updateAllMenuButtons();
 	}
 
-	while (_displayMenu && !_vm->_quitFlag) {
+	while (_displayMenu && !_vm->quit()) {
 		Common::Point mouse = _vm->getMousePos();
 		processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y);
 		processButtonList(_menuButtonList, 0, 0);
@@ -496,9 +495,6 @@
 	_mouseWheel = 0;
 	while (_vm->_eventMan->pollEvent(event)) {
 		switch (event.type) {
-		case Common::EVENT_QUIT:
-			_vm->quitGame();
-			break;
 		case Common::EVENT_LBUTTONDOWN:
 			_vm->_mousePressFlag = true;
 			break;
@@ -594,7 +590,7 @@
 	_displaySubMenu = true;
 	_cancelSubMenu = false;
 
-	while (_displaySubMenu && !_vm->_quitFlag) {
+	while (_displaySubMenu && !_vm->quit()) {
 		getInput();
 		Common::Point mouse = _vm->getMousePos();
 		processHighlights(_menu[2], mouse.x, mouse.y);
@@ -643,7 +639,7 @@
 
 	_vm->_gameToLoad = -1;
 
-	while (_displaySubMenu && !_vm->_quitFlag) {
+	while (_displaySubMenu && !_vm->quit()) {
 		getInput();
 		Common::Point mouse = _vm->getMousePos();
 		processHighlights(_menu[2], mouse.x, mouse.y);
@@ -731,7 +727,7 @@
 	}
 	redrawTextfield();
 
-	while (_displaySubMenu && !_vm->_quitFlag) {
+	while (_displaySubMenu && !_vm->quit()) {
 		getInput();
 		updateSavegameString();
 		Common::Point mouse = _vm->getMousePos();
@@ -811,7 +807,7 @@
 	_displaySubMenu = true;
 	_cancelSubMenu = true;
 
-	while (_displaySubMenu && !_vm->_quitFlag) {
+	while (_displaySubMenu && !_vm->quit()) {
 		getInput();
 		Common::Point mouse = _vm->getMousePos();
 		processHighlights(_menu[1], mouse.x, mouse.y);
@@ -877,7 +873,7 @@
 	_displaySubMenu = true;
 	_cancelSubMenu = false;
 
-	while (_displaySubMenu && !_vm->_quitFlag) {
+	while (_displaySubMenu && !_vm->quit()) {
 		getInput();
 		Common::Point mouse = _vm->getMousePos();
 		processHighlights(_menu[5], mouse.x, mouse.y);

Modified: scummvm/trunk/engines/kyra/gui_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_mr.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/gui_mr.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -870,7 +870,7 @@
 	albumNewPage();
 	_album.running = true;
 
-	while (_album.running && !_quitFlag) {
+	while (_album.running && !quit()) {
 		updateInput();
 		checkInput(buttonList);
 		removeInputTop();

Modified: scummvm/trunk/engines/kyra/gui_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_v2.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/gui_v2.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -832,13 +832,9 @@
 	int keys = 0;
 	while (_vm->_eventMan->pollEvent(event) && running) {
 		switch (event.type) {
-		case Common::EVENT_QUIT:
-			_vm->_quitFlag = true;
-			break;
-
 		case Common::EVENT_KEYDOWN:
 			if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
-				_vm->_quitFlag = true;
+				_vm->quitGame();
 			else
 				_keyPressed = event.kbd; 
 			running = false;

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -325,7 +325,7 @@
 			seq_playSequences(kSequenceFunters, kSequenceFrash);
 	}
 
-	return 0;
+	return _eventMan->shouldRTL();
 }
 
 void KyraEngine_HoF::startup() {
@@ -454,9 +454,8 @@
 void KyraEngine_HoF::runLoop() {
 	_screen->updateScreen();
 
-	_quitFlag = false;
 	_runFlag = true;
-	while (!_quitFlag && _runFlag) {
+	while (!quit() && _runFlag) {
 		if (_deathHandler >= 0) {
 			removeHandItem();
 			delay(5);
@@ -1626,7 +1625,7 @@
 	_invWsa.timer = _system->getMillis();
 
 	if (run) {
-		while (_invWsa.running && !skipFlag() && !_quitFlag) {
+		while (_invWsa.running && !skipFlag() && !quit()) {
 			update();
 			_system->delayMillis(10);
 		}
@@ -2000,7 +1999,7 @@
 		return;
 
 	_tim->resetFinishedFlag();
-	while (!_quitFlag && !_tim->finished()) {
+	while (!quit() && !_tim->finished()) {
 		_tim->exec(tim, 0);
 		if (_chatText)
 			updateWithText();

Modified: scummvm/trunk/engines/kyra/kyra_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/kyra_lok.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -26,7 +26,6 @@
 #include "kyra/kyra_lok.h"
 
 #include "common/file.h"
-#include "common/events.h"
 #include "common/system.h"
 #include "common/savefile.h"
 
@@ -119,8 +118,12 @@
 
 	delete[] _characterList;
 
+	delete[] _roomTable;
+
 	delete[] _movFacingTable;
 
+	delete[] _defaultShapeTable;
+
 	delete[] _gui->_scrollUpButton.data0ShapePtr;
 	delete[] _gui->_scrollUpButton.data1ShapePtr;
 	delete[] _gui->_scrollUpButton.data2ShapePtr;
@@ -300,8 +303,8 @@
 		if (_gameToLoad == -1) {
 			setGameFlag(0xEF);
 			seq_intro();
-			if (_quitFlag)
-				return 0;
+			if (quit())
+				return _eventMan->shouldRTL();
 			if (_skipIntroFlag && _abortIntroFlag)
 				resetGameFlag(0xEF);
 		}
@@ -309,7 +312,7 @@
 		resetGameFlag(0xEF);
 		mainLoop();
 	}
-	return 0;
+	return _eventMan->shouldRTL();
 }
 
 
@@ -399,7 +402,7 @@
 void KyraEngine_LoK::mainLoop() {
 	debugC(9, kDebugLevelMain, "KyraEngine_LoK::mainLoop()");
 
-	while (!_quitFlag) {
+	while (!quit()) {
 		int32 frameTime = (int32)_system->getMillis();
 		_skipFlag = false;
 
@@ -444,7 +447,7 @@
 }
 
 void KyraEngine_LoK::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
-	while (_system->getMillis() < timestamp && !_quitFlag) {
+	while (_system->getMillis() < timestamp && !quit()) {
 		if (updateTimers)
 			_timer->update();
 
@@ -476,7 +479,7 @@
 					if (event.kbd.keycode == 'd')
 						_debugger->attach();
 					else if (event.kbd.keycode == 'q')
-						_quitFlag = true;
+						quitGame();
 				} else if (event.kbd.keycode == '.') {
 					_skipFlag = true;
 				} else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_SPACE || event.kbd.keycode == Common::KEYCODE_ESCAPE) {
@@ -488,9 +491,6 @@
 			case Common::EVENT_MOUSEMOVE:
 				_animator->_updateScreen = true;
 				break;
-			case Common::EVENT_QUIT:
-				quitGame();
-				break;
 			case Common::EVENT_LBUTTONDOWN:
 				_mousePressFlag = true;
 				break;
@@ -529,27 +529,24 @@
 		if (_skipFlag && !_abortIntroFlag && !queryGameFlag(0xFE))
 			_skipFlag = false;
 
-		if (amount > 0 && !_skipFlag && !_quitFlag)
+		if (amount > 0 && !_skipFlag && !quit())
 			_system->delayMillis(10);
 
 		if (_skipFlag)
 			_sound->voiceStop();
-	} while (!_skipFlag && _system->getMillis() < start + amount && !_quitFlag);
+	} while (!_skipFlag && _system->getMillis() < start + amount && !quit());
 }
 
 void KyraEngine_LoK::waitForEvent() {
 	bool finished = false;
 	Common::Event event;
 
-	while (!finished && !_quitFlag) {
+	while (!finished && !quit()) {
 		while (_eventMan->pollEvent(event)) {
 			switch (event.type) {
 			case Common::EVENT_KEYDOWN:
 				finished = true;
 				break;
-			case Common::EVENT_QUIT:
-				quitGame();
-				break;
 			case Common::EVENT_LBUTTONDOWN:
 				finished = true;
 				_skipFlag = true;

Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -263,7 +263,7 @@
 		running = false;
 	}
 
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		_screen->_curPage = 0;
 		_screen->clearPage(0);
 
@@ -272,14 +272,14 @@
 		// XXX
 		playMenuAudioFile();
 
-		for (int i = 0; i < 64 && !_quitFlag; ++i) {
+		for (int i = 0; i < 64 && !quit(); ++i) {
 			uint32 nextRun = _system->getMillis() + 3 * _tickLength;
 			_menuAnim->displayFrame(i, 0);
 			_screen->updateScreen();
 			delayUntil(nextRun);
 		}
 
-		for (int i = 64; i > 29 && !_quitFlag; --i) {
+		for (int i = 64; i > 29 && !quit(); --i) {
 			uint32 nextRun = _system->getMillis() + 3 * _tickLength;
 			_menuAnim->displayFrame(i, 0);
 			_screen->updateScreen();
@@ -324,7 +324,7 @@
 	if (_showOutro)
 		playVQA("CREDITS");
 
-	return 0;
+	return _eventMan->shouldRTL();
 }
 
 void KyraEngine_MR::initMainMenu() {
@@ -1001,7 +1001,7 @@
 	_eventList.clear();
 
 	_runFlag = true;
-	while (_runFlag && !_quitFlag) {
+	while (_runFlag && !quit()) {
 		if (_deathHandler >= 0) {
 			removeHandItem();
 			delay(5);

Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -52,8 +52,6 @@
 	_gameSpeed = 60;
 	_tickLength = (uint8)(1000.0 / _gameSpeed);
 
-	_quitFlag = false;
-
 	_speechFile = "";
 	_trackMap = 0;
 	_trackMapSize = 0;
@@ -202,7 +200,10 @@
 
 void KyraEngine_v1::quitGame() {
 	debugC(9, kDebugLevelMain, "KyraEngine_v1::quitGame()");
-	_quitFlag = true;
+	Common::Event event;
+
+	event.type = Common::EVENT_QUIT;
+	_eventMan->pushEvent(event);
 	// Nothing to do here
 }
 
@@ -240,7 +241,7 @@
 }
 
 void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
-	while (_system->getMillis() < timestamp && !_quitFlag) {
+	while (_system->getMillis() < timestamp && !quit()) {
 		if (timestamp - _system->getMillis() >= 10)
 			delay(10, update, isMainLoop);
 	}

Modified: scummvm/trunk/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.h	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/kyra_v1.h	2008-09-01 17:52:50 UTC (rev 34246)
@@ -118,8 +118,6 @@
 
 	virtual void pauseEngineIntern(bool pause);
 
-	bool quit() const { return _quitFlag; }
-
 	uint8 game() const { return _flags.gameID; }
 	const GameFlags &gameFlags() const { return _flags; }
 
@@ -178,9 +176,6 @@
 	virtual int go() = 0;
 	virtual int init();
 
-	// quit Handling
-	bool _quitFlag;
-
 	// intern
 	Resource *_res;
 	Sound *_sound;

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -159,7 +159,7 @@
 
 		if (amount > 0)
 			_system->delayMillis(amount > 10 ? 10 : amount);
-	} while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag);
+	} while (!skipFlag() && _system->getMillis() < start + amount && !quit());
 }
 
 int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
@@ -238,15 +238,11 @@
 
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
-		case Common::EVENT_QUIT:
-			_quitFlag = true;
-			break;
-
 		case Common::EVENT_KEYDOWN:
 			if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE)
 				_eventList.push_back(Event(event, true));
 			else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
-				_quitFlag = true;
+				quitGame();
 			else
 				_eventList.push_back(event);
 			break;

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/lol.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -183,15 +183,11 @@
 
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
-		case Common::EVENT_QUIT:
-			_quitFlag = true;
-			break;
-
 		case Common::EVENT_KEYDOWN:
 			if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE)
 				_eventList.push_back(Event(event, true));
 			else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
-				_quitFlag = true;
+				quitGame();
 			else
 				_eventList.push_back(event);
 			break;
@@ -307,7 +303,7 @@
 	_screen->hideMouse();
 
 	uint32 palNextFadeStep = 0;
-	while (!_tim->finished() && !_quitFlag && !skipFlag()) {
+	while (!_tim->finished() && !quit() && !skipFlag()) {
 		updateInput();
 		_tim->exec(intro, false);
 		_screen->checkedPageUpdate(8, 4);
@@ -385,14 +381,14 @@
 	_screen->fadePalette(_screen->getPalette(0), 30, 0);
 	
 	bool kingIntro = true;
-	while (!_quitFlag) {
+	while (!quit()) {
 		if (kingIntro)
 			kingSelectionIntro();
 
 		if (_charSelection < 0)
 			processCharacterSelection();
 
-		if (_quitFlag)
+		if (quit())
 			break;
 
 		if (_charSelection == 100) {
@@ -413,11 +409,11 @@
 		}
 	}
 
-	if (_quitFlag)
+	if (quit())
 		return -1;
 
 	uint32 waitTime = _system->getMillis() + 420 * _tickLength;
-	while (waitTime > _system->getMillis() && !skipFlag() && !_quitFlag) {
+	while (waitTime > _system->getMillis() && !skipFlag() && !quit()) {
 		updateInput();
 		_system->delayMillis(10);
 	}
@@ -449,7 +445,7 @@
 	_chargenWSA->setDrawPage(0);
 	
 	int index = 4;
-	while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !_quitFlag && !skipFlag()) {
+	while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !quit() && !skipFlag()) {
 		index = MAX(index, 4);
 
 		_chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0);
@@ -460,7 +456,7 @@
 		_screen->updateScreen();
 
 		uint32 waitEnd = _system->getMillis() + 7 * _tickLength;
-		while (waitEnd > _system->getMillis() && _charSelection == -1 && !_quitFlag && !skipFlag()) {
+		while (waitEnd > _system->getMillis() && _charSelection == -1 && !quit() && !skipFlag()) {
 			_charSelection = getCharSelection();
 			_system->delayMillis(10);
 		}
@@ -491,7 +487,7 @@
 	_chargenWSA->setDrawPage(0);
 	
 	int index = 0;
-	while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !_quitFlag && index < 15) {
+	while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !quit() && index < 15) {
 		_chargenWSA->displayFrame(_chargenFrameTable[index+9], 0, 0, 0);
 		_screen->copyRegion(_selectionPosTable[_reminderChar1IdxTable[index]*2+0], _selectionPosTable[_reminderChar1IdxTable[index]*2+1], _charPreviews[0].x, _charPreviews[0].y, 32, 32, 4, 0);
 		_screen->copyRegion(_selectionPosTable[_reminderChar2IdxTable[index]*2+0], _selectionPosTable[_reminderChar2IdxTable[index]*2+1], _charPreviews[1].x, _charPreviews[1].y, 32, 32, 4, 0);
@@ -500,7 +496,7 @@
 		_screen->updateScreen();
 
 		uint32 waitEnd = _system->getMillis() + 8 * _tickLength;
-		while (waitEnd > _system->getMillis() && !_quitFlag) {
+		while (waitEnd > _system->getMillis() && !quit()) {
 			_charSelection = getCharSelection();
 			_system->delayMillis(10);
 		}
@@ -521,14 +517,14 @@
 	_chargenWSA->setDrawPage(0);
 
 	int index = 0;
-	while (_sound->voiceIsPlaying("KING03") && !_quitFlag && !skipFlag()) {
+	while (_sound->voiceIsPlaying("KING03") && !quit() && !skipFlag()) {
 		index = MAX(index, 4);
 
 		_chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0);
 		_screen->updateScreen();
 
 		uint32 waitEnd = _system->getMillis() + 8 * _tickLength;
-		while (waitEnd > _system->getMillis() && !_quitFlag && !skipFlag()) {
+		while (waitEnd > _system->getMillis() && !quit() && !skipFlag()) {
 			updateInput();
 			_system->delayMillis(10);
 		}
@@ -547,10 +543,10 @@
 	debugC(9, kDebugLevelMain, "LoLEngine::processCharacterSelection()");
 	
 	_charSelection = -1;
-	while (!_quitFlag && _charSelection == -1) {
+	while (!quit() && _charSelection == -1) {
 		uint32 nextKingMessage = _system->getMillis() + 900 * _tickLength;
 
-		while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !_quitFlag) {
+		while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !quit()) {
 			updateSelectionAnims();
 			_charSelection = getCharSelection();
 			_system->delayMillis(10);
@@ -669,12 +665,12 @@
 	int index = 0;
 	file[4] = '0';
 	
-	while (_charSelectionInfoResult == -1 && !_quitFlag) {
+	while (_charSelectionInfoResult == -1 && !quit()) {
 		if (!_sound->voicePlay(file))
 			break;
 
 		int i = 0;
-		while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !_quitFlag) {
+		while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !quit()) {
 			_screen->drawShape(0, _screen->getPtrToShape(_screen->getCPagePtr(9), _charInfoFrameTable[i]), 11, 130, 0, 0);
 			_screen->updateScreen();
 

Modified: scummvm/trunk/engines/kyra/saveload.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/saveload.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -178,7 +178,7 @@
 
 Common::WriteStream *KyraEngine_v1::openSaveForWriting(const char *filename, const char *saveName, const Graphics::Surface *thumbnail) const {
 	debugC(9, kDebugLevelMain, "KyraEngine_v1::openSaveForWriting('%s', '%s', %p)", filename, saveName, (const void *)thumbnail);
-	if (_quitFlag)
+	if (quit())
 		return 0;
 
 	Common::WriteStream *out = 0;

Modified: scummvm/trunk/engines/kyra/saveload_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload_lok.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/saveload_lok.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -221,7 +221,7 @@
 void KyraEngine_LoK::saveGame(const char *fileName, const char *saveName, const Graphics::Surface *thumb) {
 	debugC(9, kDebugLevelMain, "KyraEngine_LoK::saveGame('%s', '%s', %p)", fileName, saveName, (const void *)thumb);
 	
-	if (_quitFlag)
+	if (quit())
 		return;
 
 	Common::OutSaveFile *out = openSaveForWriting(fileName, saveName, thumb);

Modified: scummvm/trunk/engines/kyra/scene_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_hof.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/scene_hof.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -277,7 +277,7 @@
 	int changedScene = 0;
 	const int *moveTableStart = moveTable;
 	_unk4 = 0;
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		if (*moveTable >= 0 && *moveTable <= 7) {
 			_mainCharacter.facing = getOppositeFacingDirection(*moveTable);
 			unkFlag = true;

Modified: scummvm/trunk/engines/kyra/scene_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_mr.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/scene_mr.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -654,7 +654,7 @@
 	const int *moveTableStart = moveTable;
 	_unk4 = 0;
 
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		if (*moveTable >= 0 && *moveTable <= 7) {
 			_mainCharacter.facing = getOppositeFacingDirection(*moveTable);
 			unkFlag = true;

Modified: scummvm/trunk/engines/kyra/script_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_mr.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/script_mr.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -786,7 +786,7 @@
 	_screen->_curPage = curPageBackUp;
 	_screen->showMouse();
 
-	while (!_quitFlag) {
+	while (!quit()) {
 		int keys = checkInput(0);
 		removeInputTop();
 

Modified: scummvm/trunk/engines/kyra/sequences_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_hof.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/sequences_hof.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -75,7 +75,7 @@
 	_seqEndTime = 0;
 	_menuChoice = 0;
 
-	for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
+	for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
 		_screen->clearPage(0);
 		_screen->clearPage(8);
 		memcpy(_screen->getPalette(1), _screen->getPalette(0), 0x300);
@@ -131,7 +131,7 @@
 
 		seq_sequenceCommand(cseq.startupCommand);
 
-		if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+		if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
 			_screen->copyPage(2, 0);
 			_screen->updateScreen();
 		}
@@ -165,7 +165,7 @@
 			_seqWsaCurrentFrame = cseq.startFrame;
 
 			bool loop = true;
-			while (loop && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+			while (loop && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
 				_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
 
 				if (_seqWsa || !cb)
@@ -189,16 +189,16 @@
 				seq_processWSAs();
 				seq_processText();
 
-				if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+				if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
 					_screen->copyPage(2, 0);
 					_screen->updateScreen();
 				}
 
 				bool loop2 = true;
-				while (loop2 && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+				while (loop2 && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
 					if (_seqWsa) {
 						seq_processText();
-						if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+						if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
 							_screen->copyPage(2, 0);
 							_screen->updateScreen();
 						}
@@ -230,7 +230,7 @@
 		} else {
 			_seqFrameDelay = cseq.frameDelay;
 			_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
-			while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+			while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
 				_seqSubFrameStartTime = _system->getMillis();
 				seq_processWSAs();
 				if (cb)
@@ -262,7 +262,7 @@
 			dl = ct;
 		_seqEndTime = _system->getMillis() + dl;
 
-		while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+		while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
 			_seqSubFrameStartTime = _system->getMillis();
 			seq_processWSAs();
 
@@ -2267,7 +2267,7 @@
 void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {
 	int xa = 0, ya = 0;
 	command--;
-	if (!_activeWSA[wsaNum].movie || skipFlag() || _quitFlag || _abortIntroFlag)
+	if (!_activeWSA[wsaNum].movie || skipFlag() || quit() || _abortIntroFlag)
 		return;
 
 	switch (command) {
@@ -2467,7 +2467,7 @@
 
 void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) {
 	uint8 colormap[16];
-	if (skipFlag() || _quitFlag || _abortIntroFlag || _menuChoice)
+	if (skipFlag() || quit() || _abortIntroFlag || _menuChoice)
 		return;
 
 	memset(&_screen->getPalette(0)[0x2fa], 0x3f, 6);
@@ -2957,7 +2957,7 @@
 
 		++_invWsa.curFrame;
 
-		if (_invWsa.curFrame >= _invWsa.lastFrame && !_quitFlag)
+		if (_invWsa.curFrame >= _invWsa.lastFrame && !quit())
 			break;
 
 		switch (_invWsa.curFrame) {

Modified: scummvm/trunk/engines/kyra/sequences_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_lok.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/sequences_lok.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -34,7 +34,6 @@
 #include "kyra/text.h"
 #include "kyra/timer.h"
 
-#include "common/events.h"
 #include "common/system.h"
 #include "common/savefile.h"
 
@@ -164,7 +163,7 @@
 	_screen->updateScreen();
 	_screen->fadeFromBlack();
 
-	if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || _quitFlag) {
+	if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || quit()) {
 		_screen->fadeToBlack();
 		_screen->clearPage(0);
 		return;
@@ -176,14 +175,14 @@
 		_screen->setScreenPalette(_screen->_currentPalette);
 	}
 
-	if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || _quitFlag) {
+	if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || quit()) {
 		_screen->fadeToBlack();
 		_screen->clearPage(0);
 		return;
 	}
 	_screen->fillRect(0, 179, 319, 199, 0);
 
-	if (_quitFlag)
+	if (quit())
 		return;
 
 	if (_flags.platform == Common::kPlatformAmiga) {
@@ -223,10 +222,10 @@
 
 			oldDistance = distance;
 			delay(10);
-		} while (!doneFlag && !_quitFlag && !_abortIntroFlag);
+		} while (!doneFlag && !quit() && !_abortIntroFlag);
 	}
 
-	if (_quitFlag)
+	if (quit())
 		return;
 
 	_seq->playSequence(_seq_Forest, true);
@@ -1030,7 +1029,7 @@
 
 void KyraEngine_LoK::seq_playEnding() {
 	debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playEnding()");
-	if (_quitFlag)
+	if (quit())
 		return;
 	_screen->hideMouse();
 	_screen->_curPage = 0;
@@ -1186,8 +1185,8 @@
 			case Common::EVENT_KEYDOWN:
 				finished = true;
 				break;
+			case Common::EVENT_RTL:
 			case Common::EVENT_QUIT:
-				quitGame();
 				finished = true;
 				break;
 			default:
@@ -1211,7 +1210,7 @@
 
 bool KyraEngine_LoK::seq_skipSequence() const {
 	debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_skipSequence()");
-	return _quitFlag || _abortIntroFlag;
+	return quit() || _abortIntroFlag;
 }
 
 int KyraEngine_LoK::handleMalcolmFlag() {

Modified: scummvm/trunk/engines/kyra/sprites.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sprites.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/sprites.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -28,7 +28,6 @@
 #include "common/stream.h"
 #include "common/util.h"
 #include "common/system.h"
-#include "common/events.h"
 #include "kyra/screen.h"
 #include "kyra/kyra_lok.h"
 #include "kyra/sprites.h"

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -920,6 +920,7 @@
 	uint8 **data = (uint8**)ptr;
 	while (size--)
 		delete[] data[size];
+	delete[] data;
 	ptr = 0;
 	size = 0;
 }

Modified: scummvm/trunk/engines/kyra/text.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/text.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -29,7 +29,6 @@
 #include "kyra/screen.h"
 #include "kyra/text.h"
 
-#include "common/events.h"
 #include "common/system.h"
 #include "common/endian.h"
 

Modified: scummvm/trunk/engines/kyra/text_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_hof.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/text_hof.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -335,7 +335,7 @@
 	const uint32 endTime = _chatEndTime;
 	resetSkipFlag();
 
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		if (!_emc->isValid(&_chatScriptState))
 			_emc->start(&_chatScriptState, 1);
 
@@ -353,7 +353,7 @@
 
 		uint32 nextFrame = _system->getMillis() + delayTime * _tickLength;
 
-		while (_system->getMillis() < nextFrame && !_quitFlag) {
+		while (_system->getMillis() < nextFrame && !quit()) {
 			updateWithText();
 
 			const uint32 curTime = _system->getMillis();
@@ -593,7 +593,7 @@
 
 	if (_currentTalkSections.STATim) {
 		_tim->resetFinishedFlag();
-		while (!_quitFlag && !_tim->finished()) {
+		while (!quit() && !_tim->finished()) {
 			_tim->exec(_currentTalkSections.STATim, false);
 			if (_chatText)
 				updateWithText();
@@ -609,7 +609,7 @@
 
 	if (_currentTalkSections.ENDTim) {
 		_tim->resetFinishedFlag();
-		while (!_quitFlag && !_tim->finished()) {
+		while (!quit() && !_tim->finished()) {
 			_tim->exec(_currentTalkSections.ENDTim, false);
 			if (_chatText)
 				updateWithText();
@@ -647,10 +647,10 @@
 		_chatVocHigh = _chatVocLow = -1;
 	}
 
-	while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(_quitFlag || skipFlag())) {
+	while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(quit() || skipFlag())) {
 		if ((!speechEnabled() && chatAnimEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) {
 			_tim->resetFinishedFlag();
-			while (!_tim->finished() && !skipFlag() && !_quitFlag) {
+			while (!_tim->finished() && !skipFlag() && !quit()) {
 				if (_currentTalkSections.TLKTim)
 					_tim->exec(_currentTalkSections.TLKTim, false);
 				else

Modified: scummvm/trunk/engines/kyra/text_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_lok.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/text_lok.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -120,8 +120,8 @@
 					if (event.kbd.keycode == '.')
 						_skipFlag = true;
 					break;
+				case Common::EVENT_RTL:
 				case Common::EVENT_QUIT:
-					quitGame();
 					runLoop = false;
 					break;
 				case Common::EVENT_LBUTTONDOWN:

Modified: scummvm/trunk/engines/kyra/text_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_mr.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/text_mr.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -349,7 +349,7 @@
 	const uint32 endTime = _chatEndTime;
 	resetSkipFlag();
 
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		if (!_emc->isValid(&_chatScriptState))
 			_emc->start(&_chatScriptState, 1);
 
@@ -367,7 +367,7 @@
 
 		uint32 nextFrame = _system->getMillis() + delayTime * _tickLength;
 
-		while (_system->getMillis() < nextFrame && !_quitFlag) {
+		while (_system->getMillis() < nextFrame && !quit()) {
 			updateWithText();
 
 			const uint32 curTime = _system->getMillis();
@@ -419,7 +419,7 @@
 	uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength;
 
 	int frame = _badConscienceFrameTable[_badConscienceAnim+24];
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		if (nextFrame < _system->getMillis()) {
 			++frame;
 			if (_badConscienceFrameTable[_badConscienceAnim+32] < frame)
@@ -477,7 +477,7 @@
 	uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(3, 6) * _tickLength;
 
 	int frame = _goodConscienceFrameTable[_goodConscienceAnim+15];
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		if (nextFrame < _system->getMillis()) {
 			++frame;
 			if (_goodConscienceFrameTable[_goodConscienceAnim+20] < frame)
@@ -597,7 +597,7 @@
 
 	uint32 nextFrame = 0;
 	int frame = 12;
-	while (running && !_quitFlag) {
+	while (running && !quit()) {
 		if (nextFrame < _system->getMillis()) {
 			++frame;
 			if (frame > 22)

Modified: scummvm/trunk/engines/kyra/vqa.cpp
===================================================================
--- scummvm/trunk/engines/kyra/vqa.cpp	2008-09-01 17:50:00 UTC (rev 34245)
+++ scummvm/trunk/engines/kyra/vqa.cpp	2008-09-01 17:52:50 UTC (rev 34246)
@@ -32,7 +32,6 @@
 // The jung2.vqa movie does work, but only thanks to a grotesque hack.
 
 
-#include "common/events.h"
 #include "common/system.h"
 #include "sound/audiostream.h"
 #include "sound/mixer.h"
@@ -671,8 +670,8 @@
 					if (event.kbd.ascii == 27)
 						return;
 					break;
+				case Common::EVENT_RTL:
 				case Common::EVENT_QUIT:
-					_vm->quitGame();
 					return;
 				default:
 					break;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list