[Scummvm-cvs-logs] SF.net SVN: scummvm:[44290] scummvm/trunk/engines/lure

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Sep 24 08:53:04 CEST 2009


Revision: 44290
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44290&view=rev
Author:   thebluegr
Date:     2009-09-24 06:53:03 +0000 (Thu, 24 Sep 2009)

Log Message:
-----------
Changed some references from LureEngine to the global g_engine (e.g. calls to shouldQuit()), to minimize places where LureEngine is referenced

Modified Paths:
--------------
    scummvm/trunk/engines/lure/events.cpp
    scummvm/trunk/engines/lure/fights.cpp
    scummvm/trunk/engines/lure/game.cpp
    scummvm/trunk/engines/lure/menu.cpp
    scummvm/trunk/engines/lure/scripts.cpp
    scummvm/trunk/engines/lure/surface.cpp

Modified: scummvm/trunk/engines/lure/events.cpp
===================================================================
--- scummvm/trunk/engines/lure/events.cpp	2009-09-24 04:17:56 UTC (rev 44289)
+++ scummvm/trunk/engines/lure/events.cpp	2009-09-24 06:53:03 UTC (rev 44290)
@@ -138,12 +138,11 @@
 
 void Mouse::waitForRelease() {
 	Events &e = Events::getReference();
-	LureEngine &engine = LureEngine::getReference();
 
 	do {
-		while (e.pollEvent() && !engine.shouldQuit()) ;
+		while (e.pollEvent() && !g_engine->shouldQuit()) ;
 		g_system->delayMillis(20);
-	} while (!engine.shouldQuit() && (lButton() || rButton() || mButton()));
+	} while (!g_engine->shouldQuit() && (lButton() || rButton() || mButton()));
 }
 
 /*--------------------------------------------------------------------------*/
@@ -207,11 +206,10 @@
 
 bool Events::interruptableDelay(uint32 milliseconds) {
 	Events &events = Events::getReference();
-	LureEngine &engine = LureEngine::getReference();
 	uint32 delayCtr = g_system->getMillis() + milliseconds;
 
 	while (g_system->getMillis() < delayCtr) {
-		if (engine.shouldQuit()) return true;
+		if (g_engine->shouldQuit()) return true;
 
 		if (events.pollEvent()) {
 			if (((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0)) ||

Modified: scummvm/trunk/engines/lure/fights.cpp
===================================================================
--- scummvm/trunk/engines/lure/fights.cpp	2009-09-24 04:17:56 UTC (rev 44289)
+++ scummvm/trunk/engines/lure/fights.cpp	2009-09-24 06:53:03 UTC (rev 44290)
@@ -109,7 +109,6 @@
 }
 
 void FightsManager::fightLoop() {
-	LureEngine &engine = LureEngine::getReference();
 	Resources &res = Resources::getReference();
 	Game &game = Game::getReference();
 	Room &room = Room::getReference();
@@ -117,7 +116,7 @@
 	uint32 timerVal = g_system->getMillis();
 
 	// Loop for the duration of the battle
-	while (!engine.shouldQuit() && (playerFight.fwhits != GENERAL_MAGIC_ID)) {
+	while (!g_engine->shouldQuit() && (playerFight.fwhits != GENERAL_MAGIC_ID)) {
 		checkEvents();
 
 		if (g_system->getMillis() > timerVal + GAME_FRAME_DELAY) {
@@ -185,7 +184,6 @@
 	{Common::KEYCODE_INVALID, 0}};
 
 void FightsManager::checkEvents() {
-	LureEngine &engine = LureEngine::getReference();
 	Game &game = Game::getReference();
 	Events &events = Events::getReference();
 	Mouse &mouse = Mouse::getReference();
@@ -198,7 +196,7 @@
 		if (events.type() == Common::EVENT_KEYDOWN) {
 			switch (events.event().kbd.keycode) {
 			case Common::KEYCODE_ESCAPE:
-				engine.quitGame();
+				g_engine->quitGame();
 				return;
 
 			case Common::KEYCODE_d:

Modified: scummvm/trunk/engines/lure/game.cpp
===================================================================
--- scummvm/trunk/engines/lure/game.cpp	2009-09-24 04:17:56 UTC (rev 44289)
+++ scummvm/trunk/engines/lure/game.cpp	2009-09-24 06:53:03 UTC (rev 44290)
@@ -151,7 +151,7 @@
 
 	bool initialRestart = true;
 
-	while (!engine.shouldQuit()) {
+	while (!g_engine->shouldQuit()) {
 
 		if ((_state & GS_RESTART) != 0) {
 			res.reset();
@@ -171,7 +171,7 @@
 		mouse.cursorOn();
 
 		// Main game loop
-		while (!engine.shouldQuit() && ((_state & GS_RESTART) == 0)) {
+		while (!g_engine->shouldQuit() && ((_state & GS_RESTART) == 0)) {
 			// If time for next frame, allow everything to update
 			if (system.getMillis() > timerVal + GAME_FRAME_DELAY) {
 				timerVal = system.getMillis();
@@ -898,7 +898,7 @@
 void Game::doQuit() {
 	Sound.pause();
 	if (getYN())
-		LureEngine::getReference().quitGame();
+		g_engine->quitGame();
 	Sound.resume();
 }
 
@@ -983,7 +983,6 @@
 	Events &events = Events::getReference();
 	Screen &screen = Screen::getReference();
 	Resources &res = Resources::getReference();
-	LureEngine &engine = LureEngine::getReference();
 
 	Common::Language l = LureEngine::getReference().getLanguage();
 	Common::KeyCode y = Common::KEYCODE_y;
@@ -1025,7 +1024,7 @@
 		}
 
 		g_system->delayMillis(10);
-	} while (!engine.shouldQuit() && !breakFlag);
+	} while (!g_engine->shouldQuit() && !breakFlag);
 
 	screen.update();
 	if (!vKbdFlag)

Modified: scummvm/trunk/engines/lure/menu.cpp
===================================================================
--- scummvm/trunk/engines/lure/menu.cpp	2009-09-24 04:17:56 UTC (rev 44289)
+++ scummvm/trunk/engines/lure/menu.cpp	2009-09-24 06:53:03 UTC (rev 44290)
@@ -116,7 +116,6 @@
 
 uint8 Menu::execute() {
 	OSystem &system = *g_system;
-	LureEngine &engine = LureEngine::getReference();
 	Mouse &mouse = Mouse::getReference();
 	Events &events = Events::getReference();
 	Screen &screen = Screen::getReference();
@@ -131,7 +130,7 @@
 
 	while (mouse.lButton() || mouse.rButton()) {
 		while (events.pollEvent()) {
-			if (engine.shouldQuit()) return MENUITEM_NONE;
+			if (g_engine->shouldQuit()) return MENUITEM_NONE;
 
 			if (mouse.y() < MENUBAR_Y_SIZE) {
 				MenuRecord *p = getMenuAt(mouse.x());
@@ -468,7 +467,6 @@
 
 uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
 	if (numEntries == 0) return 0xffff;
-	LureEngine &engine = LureEngine::getReference();
 	Events &e = Events::getReference();
 	Mouse &mouse = Mouse::getReference();
 	OSystem &system = *g_system;
@@ -547,7 +545,7 @@
 		}
 
 		while (e.pollEvent()) {
-			if (engine.shouldQuit()) {
+			if (g_engine->shouldQuit()) {
 				selectedIndex = 0xffff;
 				goto bail_out;
 

Modified: scummvm/trunk/engines/lure/scripts.cpp
===================================================================
--- scummvm/trunk/engines/lure/scripts.cpp	2009-09-24 04:17:56 UTC (rev 44289)
+++ scummvm/trunk/engines/lure/scripts.cpp	2009-09-24 06:53:03 UTC (rev 44290)
@@ -192,7 +192,6 @@
 }
 
 void Script::endgameSequence(uint16 v1, uint16 v2, uint16 v3) {
-	LureEngine &engine = LureEngine::getReference();
 	Screen &screen = Screen::getReference();
 	Mouse &mouse = Mouse::getReference();
 	Events &events = Events::getReference();
@@ -222,7 +221,7 @@
 	anim->show();
 	if (!events.interruptableDelay(30000)) {
 		// No key yet pressed, so keep waiting
-		while (Sound.musicInterface_CheckPlaying(6) && !engine.shouldQuit()) {
+		while (Sound.musicInterface_CheckPlaying(6) && !g_engine->shouldQuit()) {
 			if (events.interruptableDelay(20))
 				break;
 		}
@@ -230,7 +229,7 @@
 	delete anim;
 
 	screen.paletteFadeOut();
-	engine.quitGame();
+	g_engine->quitGame();
 }
 
 // Setup the pig fight in the cave

Modified: scummvm/trunk/engines/lure/surface.cpp
===================================================================
--- scummvm/trunk/engines/lure/surface.cpp	2009-09-24 04:17:56 UTC (rev 44289)
+++ scummvm/trunk/engines/lure/surface.cpp	2009-09-24 06:53:03 UTC (rev 44290)
@@ -506,7 +506,6 @@
 
 bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool varLength, int16 x, int16 y) {
 	OSystem &system = *g_system;
-	LureEngine &engine = LureEngine::getReference();
 	Mouse &mouse = Mouse::getReference();
 	Events &events = Events::getReference();
 	Screen &screen = Screen::getReference();
@@ -534,7 +533,7 @@
 		// Loop until the input string changes
 		refreshFlag = false;
 		while (!refreshFlag && !abortFlag) {
-			abortFlag = engine.shouldQuit();
+			abortFlag = g_engine->shouldQuit();
 			if (abortFlag) break;
 
 			while (events.pollEvent()) {
@@ -976,7 +975,7 @@
 		// Provide highlighting of lines to select a save slot
 		while (!abortFlag && !(mouse.lButton() && (selectedLine != -1))
 				&& !mouse.rButton() && !mouse.mButton()) {
-			abortFlag = engine.shouldQuit();
+			abortFlag = g_engine->shouldQuit();
 			if (abortFlag) break;
 
 			while (events.pollEvent()) {
@@ -1179,7 +1178,7 @@
 		// Event loop for making selection
 		bool buttonPressed = false;
 
-		while (!engine.shouldQuit()) {
+		while (!g_engine->shouldQuit()) {
 			// Handle events
 			while (events.pollEvent()) {
 				if ((events.type() == Common::EVENT_LBUTTONDOWN) && (highlightedButton != -1)) {
@@ -1231,7 +1230,7 @@
 
 	Sound.killSounds();
 
-	if (!restartFlag && !engine.shouldQuit()) {
+	if (!restartFlag && !g_engine->shouldQuit()) {
 		// Need to show Restore game dialog
 		if (!SaveRestoreDialog::show(false))
 			// User cancelled, so fall back on Restart
@@ -1299,7 +1298,6 @@
 bool CopyProtectionDialog::show() {
 	Screen &screen = Screen::getReference();
 	Events &events = Events::getReference();
-	LureEngine &engine = LureEngine::getReference();
 
 	screen.setPaletteEmpty();
 	Palette p(COPY_PROTECTION_RESOURCE_ID - 1);
@@ -1350,7 +1348,7 @@
 		// Clear any prior try
 		_charIndex = 0;
 
-		while (!engine.shouldQuit()) {
+		while (!g_engine->shouldQuit()) {
 			while (events.pollEvent() && (_charIndex < 4)) {
 				if (events.type() == Common::EVENT_KEYDOWN) {
 					if ((events.event().kbd.keycode == Common::KEYCODE_BACKSPACE) && (_charIndex > 0)) {
@@ -1384,7 +1382,7 @@
 				break;
 		}
 
-		if (engine.shouldQuit())
+		if (g_engine->shouldQuit())
 			return false;
 
 		// At this point, two page numbers have been entered - validate them


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