[Scummvm-cvs-logs] SF.net SVN: scummvm: [32775] scummvm/branches/gsoc2008-rtl/engines

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Wed Jun 25 05:17:01 CEST 2008


Revision: 32775
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32775&view=rev
Author:   cpage88
Date:     2008-06-24 20:17:01 -0700 (Tue, 24 Jun 2008)

Log Message:
-----------
Scumm and sky now use the new _quit flag

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/engines/engine.h
    scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.cpp
    scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.h
    scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/intro.h
    scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/sky.h

Modified: scummvm/branches/gsoc2008-rtl/engines/engine.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/engine.h	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/engine.h	2008-06-25 03:17:01 UTC (rev 32775)
@@ -50,7 +50,10 @@
 	Audio::Mixer *_mixer;
 	Common::TimerManager * _timer;
 
+	/** We keep running until this is set to true. */
 	bool _quit;
+
+	/** This is used when returning from go() to specifiy if we return to the launcher (true), or quit (false). */
 	bool _rtl;
 
 protected:

Modified: scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.cpp	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.cpp	2008-06-25 03:17:01 UTC (rev 32775)
@@ -1759,7 +1759,7 @@
 		}
 	}
 
-	return 0;
+	return _rtl;
 }
 
 void ScummEngine::waitForTimer(int msec_delay) {

Modified: scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.h	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/scumm/scumm.h	2008-06-25 03:17:01 UTC (rev 32775)
@@ -498,9 +498,6 @@
 	void restart();
 	void shutDown();
 
-	/** We keep running until this is set to true. */
-	bool _quit;
-
 protected:
 	Dialog *_pauseDialog;
 	Dialog *_versionDialog;

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp	2008-06-25 03:17:01 UTC (rev 32775)
@@ -492,7 +492,7 @@
 	_curButtonText = 0;
 	uint16 clickRes = 0;
 
-	while (!quitPanel && !SkyEngine::_systemVars.quitGame) {
+	while (!quitPanel && !g_engine->_quit) {
 		_text->drawToScreen(WITH_MASK);
 		_system->updateScreen();
 		_mouseClicked = false;
@@ -524,7 +524,7 @@
 	}
 	memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
 	_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
-	if (!SkyEngine::_systemVars.quitGame)
+	if (!g_engine->_quit)
 		_system->updateScreen();
 	_skyScreen->forceRefresh();
 	_skyScreen->setPaletteEndian((uint8 *)_skyCompact->fetchCpt(SkyEngine::_systemVars.currentPalette));
@@ -603,7 +603,7 @@
 	case QUIT_TO_DOS:
 		animClick(pButton);
 		if (getYesNo(quitDos))
-			SkyEngine::_systemVars.quitGame = true;
+			g_engine->_quit = true;
 		return 0;
 	default:
 		error("Control::handleClick: unknown routine: %X",pButton->_onClick);
@@ -875,7 +875,7 @@
 	bool refreshNames = true;
 	bool refreshAll = true;
 	uint16 clickRes = 0;
-	while (!quitPanel && !SkyEngine::_systemVars.quitGame) {
+	while (!quitPanel && !g_engine->_quit) {
 		clickRes = 0;
 		if (refreshNames || refreshAll) {
 			if (refreshAll) {
@@ -1547,7 +1547,7 @@
 				_mouseWheel = 1;
 				break;
 			case Common::EVENT_QUIT:
-				SkyEngine::_systemVars.quitGame = true;
+				g_engine->_quit = true;
 				break;
 			default:
 				break;

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp	2008-06-25 03:17:01 UTC (rev 32775)
@@ -636,7 +636,6 @@
 	_textBuf = (uint8*)malloc(10000);
 	_saveBuf = (uint8*)malloc(10000);
 	_bgBuf = NULL;
-	_quitProg = false;
 	_relDelay = 0;
 }
 
@@ -913,7 +912,7 @@
 				if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
 					return false;
 			} else if (event.type == Common::EVENT_QUIT) {
-				_quitProg = true;
+				g_engine->_quit = true;
 				return false;
 			}
 		}

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/intro.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/intro.h	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/intro.h	2008-06-25 03:17:01 UTC (rev 32775)
@@ -43,7 +43,6 @@
 	Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *text, Audio::Mixer *mixer, OSystem *system);
 	~Intro(void);
 	bool doIntro(bool floppyIntro);
-	bool _quitProg;
 private:
 	static uint16 _mainIntroSeq[];
 	static uint16 _floppyIntroSeq[];

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp	2008-06-25 03:17:01 UTC (rev 32775)
@@ -2489,7 +2489,7 @@
 }
 
 bool Logic::fnQuitToDos(uint32 a, uint32 b, uint32 c) {
-	SkyEngine::_systemVars.quitGame = true;
+	g_engine->_quit = true;
 	return false;
 }
 

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp	2008-06-25 03:17:01 UTC (rev 32775)
@@ -180,7 +180,7 @@
 	while (mousePressed || _system->getMillis() < now + minDelay) {
 
 		if (eventMan->shouldQuit()) {
-			SkyEngine::_systemVars.quitGame = true;
+			g_engine->_quit = true;
 			minDelay = 0;
 			mousePressed = false;
 		}

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp	2008-06-25 03:17:01 UTC (rev 32775)
@@ -257,7 +257,7 @@
 
 void *SkyEngine::_itemList[300];
 
-SystemVars SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false, false };
+SystemVars SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false };
 
 SkyEngine::SkyEngine(OSystem *syst)
 	: Engine(syst), _fastMode(0), _debugger(0) {
@@ -340,8 +340,6 @@
 
 int SkyEngine::go() {
 
-	_systemVars.quitGame = false;
-
 	_keyPressed.reset();
 
 	uint16 result = 0;
@@ -353,12 +351,9 @@
 		if (_systemVars.gameVersion > 267) { // don't do intro for floppydemos
 			_skyIntro = new Intro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system);
 			introSkipped = !_skyIntro->doIntro(_floppyIntro);
-			_systemVars.quitGame = _skyIntro->_quitProg;
-
-			delete _skyIntro;
 		}
 
-		if (!_systemVars.quitGame) {
+		if (!_quit) {
 			_skyLogic->initScreen0();
 			if (introSkipped)
 				_skyControl->restartGame();
@@ -368,7 +363,7 @@
 	_lastSaveTime = _system->getMillis();
 
 	uint32 delayCount = _system->getMillis();
-	while (!_systemVars.quitGame) {
+	while (!_quit) {
 		if (_debugger->isAttached())
 			_debugger->onFrame();
 
@@ -419,7 +414,7 @@
 	_skyMusic->stopMusic();
 	ConfMan.flushToDisk();
 	delay(1500);
-	return 0;
+	return _rtl;
 }
 
 int SkyEngine::init() {
@@ -616,7 +611,7 @@
 				_skyMouse->buttonPressed(1);
 				break;
 			case Common::EVENT_QUIT:
-				_systemVars.quitGame = true;
+				_quit = true;
 				break;
 			default:
 				break;

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/sky.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/sky.h	2008-06-25 02:14:55 UTC (rev 32774)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/sky.h	2008-06-25 03:17:01 UTC (rev 32775)
@@ -41,7 +41,6 @@
 	uint16 gameSpeed;
 	uint16 currentMusic;
 	bool pastIntro;
-	bool quitGame;
 	bool paused;
 };
 


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