[Scummvm-cvs-logs] SF.net SVN: scummvm:[34253] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Sep 1 22:20:21 CEST 2008


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

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

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/detection.cpp
    scummvm/trunk/engines/scumm/dialogs.cpp
    scummvm/trunk/engines/scumm/dialogs.h
    scummvm/trunk/engines/scumm/he/cup_player_he.cpp
    scummvm/trunk/engines/scumm/he/script_v100he.cpp
    scummvm/trunk/engines/scumm/he/script_v70he.cpp
    scummvm/trunk/engines/scumm/he/script_v72he.cpp
    scummvm/trunk/engines/scumm/input.cpp
    scummvm/trunk/engines/scumm/resource.cpp
    scummvm/trunk/engines/scumm/saveload.cpp
    scummvm/trunk/engines/scumm/script_v5.cpp
    scummvm/trunk/engines/scumm/script_v6.cpp
    scummvm/trunk/engines/scumm/script_v8.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/scumm.h
    scummvm/trunk/engines/scumm/smush/smush_player.cpp

Modified: scummvm/trunk/engines/scumm/detection.cpp
===================================================================
--- scummvm/trunk/engines/scumm/detection.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/detection.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -674,15 +674,24 @@
 	virtual const char *getName() const;
 	virtual const char *getCopyright() const;
 
+	virtual bool hasFeature(MetaEngineFeature f) const;	
 	virtual GameList getSupportedGames() const;
 	virtual GameDescriptor findGame(const char *gameid) const;
 	virtual GameList detectGames(const FSList &fslist) const;
-
+	
 	virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
 
 	virtual SaveStateList listSaves(const char *target) const;
 };
 
+bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const {
+	return
+		(f == kSupportsRTL) ||
+		(f == kSupportsListSaves) ||
+		(f == kSupportsDirectLoad) ||
+		(f == kSupportsDeleteSave);
+}
+
 GameList ScummMetaEngine::getSupportedGames() const {
 	return GameList(gameDescriptions);
 }
@@ -691,7 +700,6 @@
 	return Common::AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
 }
 
-
 GameList ScummMetaEngine::detectGames(const FSList &fslist) const {
 	GameList detectedGames;
 	Common::List<DetectorResult> results;

Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/dialogs.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -430,7 +430,7 @@
 	return descriptions;
 }
 
-MainMenuDialog::MainMenuDialog(ScummEngine *scumm)
+ScummMenuDialog::ScummMenuDialog(ScummEngine *scumm)
 	: ScummDialog("scummmain"), _vm(scumm) {
 
 	new GUI::ButtonWidget(this, "scummmain_resume", "Resume", kPlayCmd, 'P');
@@ -458,7 +458,7 @@
 	_loadDialog = new SaveLoadChooser("Load game:", "Load", false, scumm);
 }
 
-MainMenuDialog::~MainMenuDialog() {
+ScummMenuDialog::~ScummMenuDialog() {
 	delete _aboutDialog;
 	delete _optionsDialog;
 #ifndef DISABLE_HELP
@@ -468,7 +468,7 @@
 	delete _loadDialog;
 }
 
-void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
+void ScummMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
 	switch (cmd) {
 	case kSaveCmd:
 		save();
@@ -491,7 +491,7 @@
 		break;
 #endif
 	case kQuitCmd:
-		_vm->_quit = true;
+		_vm->quitGame();
 		close();
 		break;
 	default:
@@ -499,7 +499,7 @@
 	}
 }
 
-void MainMenuDialog::save() {
+void ScummMenuDialog::save() {
 	int idx;
 	_saveDialog->setList(generateSavegameList(_vm, true));
 	idx = _saveDialog->runModal();
@@ -518,7 +518,7 @@
 	}
 }
 
-void MainMenuDialog::load() {
+void ScummMenuDialog::load() {
 	int idx;
 	_loadDialog->setList(generateSavegameList(_vm, false));
 	idx = _loadDialog->runModal();

Modified: scummvm/trunk/engines/scumm/dialogs.h
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.h	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/dialogs.h	2008-09-01 20:20:20 UTC (rev 34253)
@@ -82,10 +82,10 @@
 	virtual void reflowLayout();
 };
 
-class MainMenuDialog : public ScummDialog {
+class ScummMenuDialog : public ScummDialog {
 public:
-	MainMenuDialog(ScummEngine *scumm);
-	~MainMenuDialog();
+	ScummMenuDialog(ScummEngine *scumm);
+	~ScummMenuDialog();
 	virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
 
 protected:

Modified: scummvm/trunk/engines/scumm/he/cup_player_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/cup_player_he.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/he/cup_player_he.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -99,7 +99,7 @@
 	debug(1, "rate %d width %d height %d", _playbackRate, _width, _height);
 
 	int ticks = _system->getMillis();
-	while (_dataSize != 0 && !_vm->_quit) {
+	while (_dataSize != 0 && !_vm->quit()) {
 		while (parseNextBlockTag(_fileStream)) {
 			if (_fileStream.ioFailed()) {
 				return;
@@ -190,7 +190,7 @@
 	CUP_SfxChannel *sfxChannel = &_sfxChannels[channel];
 	debug(1, "waitForSfxChannel %d", channel);
 	if ((sfxChannel->flags & kSfxFlagLoop) == 0) {
-		while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->_quit) {
+		while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->quit()) {
 			_vm->parseEvents();
 			_system->delayMillis(10);
 		}
@@ -496,7 +496,7 @@
 			for (int i = 0; i < kSfxChannels; ++i) {
 				waitForSfxChannel(i);
 			}
-			_vm->_quit = true;
+			_vm->quitGame();
 			break;
 		case 7: {
 				int channelSync = dataStream.readUint32LE();

Modified: scummvm/trunk/engines/scumm/he/script_v100he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v100he.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/he/script_v100he.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -2147,10 +2147,10 @@
 		break;
 	case 71:
 		// Confirm shutdown
-		shutDown();
+		quitGame();
 		break;
 	case 72:
-		shutDown();
+		quitGame();
 		break;
 	case 73:
 		copyScriptString(string, sizeof(string));

Modified: scummvm/trunk/engines/scumm/he/script_v70he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v70he.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/he/script_v70he.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -634,10 +634,10 @@
 		break;
 	case 160:
 		// Confirm shutdown
-		shutDown();
+		quitGame();
 		break;
 	case 244:
-		shutDown();
+		quitGame();
 		break;
 	case 250:
 		id = pop();

Modified: scummvm/trunk/engines/scumm/he/script_v72he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v72he.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/he/script_v72he.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -1485,10 +1485,10 @@
 		break;
 	case 160:
 		// Confirm shutdown
-		shutDown();
+		quitGame();
 		break;
 	case 244:
-		shutDown();
+		quitGame();
 		break;
 	case 251:
 		copyScriptString(string, sizeof(string));

Modified: scummvm/trunk/engines/scumm/input.cpp
===================================================================
--- scummvm/trunk/engines/scumm/input.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/input.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -192,10 +192,6 @@
 				_keyPressed = Common::KeyState(Common::KEYCODE_6, 54);	// '6'
 			break;
 
-		case Common::EVENT_QUIT:
-			_quit = true;
-			break;
-
 		default:
 			break;
 		}
@@ -475,7 +471,7 @@
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
 			runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, 0);
 
-		mainMenuDialog();		// Display NewGui
+		scummMenuDialog();		// Display NewGui
 
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
 			runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, 0);
@@ -514,7 +510,7 @@
 			vol = Audio::Mixer::kMaxMixerVolume;
 
 		ConfMan.setInt("music_volume", vol);
-		updateSoundSettings();
+		syncSoundSettings();
 
 	} else if (lastKeyHit.ascii == '-' || lastKeyHit.ascii == '+') { // Change text speed
 		if (lastKeyHit.ascii == '+' && _defaultTalkDelay > 0)

Modified: scummvm/trunk/engines/scumm/resource.cpp
===================================================================
--- scummvm/trunk/engines/scumm/resource.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/resource.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -291,7 +291,7 @@
 
 	if (checkTryMedia(_fileHandle)) {
 		displayMessage(NULL, "You're trying to run game encrypted by ActiveMark. This is not supported.");
-		_quit = true;
+		quitGame();
 
 		return;
 	}

Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/saveload.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -295,7 +295,7 @@
 	delete in;
 
 	// Update volume settings
-	updateSoundSettings();
+	syncSoundSettings();
 
 	// Init NES costume data
 	if (_game.platform == Common::kPlatformNES) {

Modified: scummvm/trunk/engines/scumm/script_v5.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v5.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/script_v5.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -1769,7 +1769,7 @@
 		pauseGame();
 		break;
 	case 3:		// SO_QUIT
-		shutDown();
+		quitGame();
 		break;
 	default:
 		error("o5_systemOps: unknown subopcode %d", subOp);

Modified: scummvm/trunk/engines/scumm/script_v6.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v6.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/script_v6.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -2310,7 +2310,7 @@
 		pauseGame();
 		break;
 	case 160:		// SO_QUIT
-		shutDown();
+		quitGame();
 		break;
 	default:
 		error("o6_systemOps invalid case %d", subOp);

Modified: scummvm/trunk/engines/scumm/script_v8.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v8.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/script_v8.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -1170,7 +1170,7 @@
 		restart();
 		break;
 	case 0x29:		// SO_SYSTEM_QUIT Quit game
-		shutDown();
+		quitGame();
 		break;
 	default:
 		error("o8_systemOps: invalid case 0x%x", subOp);
@@ -1289,7 +1289,7 @@
 		if (ConfMan.getBool("confirm_exit"))
 			confirmExitDialog();
 		else
-			_quit = true;
+			quitGame();
 		break;
 	case 108:	// buildPaletteShadow
 		setShadowPalette(args[1], args[2], args[3], args[4], args[5], args[6]);

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -109,7 +109,7 @@
 	  _language(dr.language),
 	  _debugger(0),
 	  _currentScript(0xFF), // Let debug() work on init stage
-	  _pauseDialog(0), _mainMenuDialog(0), _versionDialog(0) {
+	  _pauseDialog(0), _scummMenuDialog(0), _versionDialog(0) {
 
 	if (_game.platform == Common::kPlatformNES) {
 		_gdi = new GdiNES(this);
@@ -143,9 +143,8 @@
 	_objs = NULL;
 	_sound = NULL;
 	memset(&vm, 0, sizeof(vm));
-	_quit = false;
 	_pauseDialog = NULL;
-	_mainMenuDialog = NULL;
+	_scummMenuDialog = NULL;
 	_versionDialog = NULL;
 	_fastMode = 0;
 	_actors = NULL;
@@ -561,7 +560,7 @@
 	delete _2byteFontPtr;
 	delete _charset;
 	delete _pauseDialog;
-	delete _mainMenuDialog;
+	delete _scummMenuDialog;
 	delete _versionDialog;
 	delete _fileHandle;
 
@@ -815,7 +814,6 @@
 	_syst = syst;
 	_game = dr.game;
 	_filenamePattern = dr.fp,
-	_quit = false;
 
 	_cupPlayer = new CUP_Player(syst, this, _mixer);
 }
@@ -846,9 +844,6 @@
 
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
-		case Common::EVENT_QUIT:
-			_quit = true;
-			break;
 
 		default:
 			break;
@@ -1108,7 +1103,7 @@
 	if (_game.version >= 5 && _game.version <= 7)
 		_sound->setupSound();
 
-	updateSoundSettings();
+	syncSoundSettings();
 
 	return 0;
 }
@@ -1667,7 +1662,7 @@
 	}
 }
 
-void ScummEngine::updateSoundSettings() {
+void ScummEngine::syncSoundSettings() {
 
 	// Sync the engine with the config manager
 	int soundVolumeMusic = ConfMan.getInt("music_volume");
@@ -1721,7 +1716,7 @@
 
 	int diff = 0;	// Duration of one loop iteration
 
-	while (!_quit) {
+	while (!quit()) {
 
 		if (_debugger->isAttached())
 			_debugger->onFrame();
@@ -1754,12 +1749,12 @@
 		diff = _system->getMillis() - diff;
 
 
-		if (_quit) {
+		if (quit()) {
 			// TODO: Maybe perform an autosave on exit?
 		}
 	}
 
-	return 0;
+	return _eventMan->shouldRTL();
 }
 
 void ScummEngine::waitForTimer(int msec_delay) {
@@ -1772,7 +1767,7 @@
 
 	start_time = _system->getMillis();
 
-	while (!_quit) {
+	while (!quit()) {
 		_sound->updateCD(); // Loop CD Audio if needed
 		parseEvents();
 		_system->updateScreen();
@@ -1895,7 +1890,7 @@
 	checkExecVerbs();
 	checkAndRunSentenceScript();
 
-	if (_quit)
+	if (quit())
 		return;
 
 	// HACK: If a load was requested, immediately perform it. This avoids
@@ -2160,10 +2155,6 @@
 	pauseDialog();
 }
 
-void ScummEngine::shutDown() {
-	_quit = true;
-}
-
 void ScummEngine::restart() {
 // TODO: Check this function - we should probably be reinitting a lot more stuff, and I suspect
 //	 this leaks memory like a sieve
@@ -2305,18 +2296,18 @@
 	runDialog(*_versionDialog);
 }
 
-void ScummEngine::mainMenuDialog() {
-	if (!_mainMenuDialog)
-		_mainMenuDialog = new MainMenuDialog(this);
-	runDialog(*_mainMenuDialog);
-	updateSoundSettings();
+void ScummEngine::scummMenuDialog() {
+	if (!_scummMenuDialog)
+		_scummMenuDialog = new ScummMenuDialog(this);
+	runDialog(*_scummMenuDialog);
+	syncSoundSettings();
 }
 
 void ScummEngine::confirmExitDialog() {
 	ConfirmDialog d(this, 6);
 
 	if (runDialog(d)) {
-		_quit = true;
+		quitGame();
 	}
 }
 

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/scumm.h	2008-09-01 20:20:20 UTC (rev 34253)
@@ -462,7 +462,7 @@
 	virtual void loadLanguageBundle() {}
 	void loadCJKFont();
 	void setupMusic(int midi);
-	void updateSoundSettings();
+	virtual void syncSoundSettings();
 	void setTalkspeed(int talkspeed);
 	int getTalkspeed();
 
@@ -496,22 +496,18 @@
 public:
 	void pauseGame();
 	void restart();
-	void shutDown();
 
-	/** We keep running until this is set to true. */
-	bool _quit;
-
 protected:
 	Dialog *_pauseDialog;
 	Dialog *_versionDialog;
-	Dialog *_mainMenuDialog;
+	Dialog *_scummMenuDialog;
 
 	virtual int runDialog(Dialog &dialog);
 	void confirmExitDialog();
 	void confirmRestartDialog();
 	void pauseDialog();
 	void versionDialog();
-	void mainMenuDialog();
+	void scummMenuDialog();
 
 	char displayMessage(const char *altButton, const char *message, ...);
 

Modified: scummvm/trunk/engines/scumm/smush/smush_player.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/smush_player.cpp	2008-09-01 20:19:28 UTC (rev 34252)
+++ scummvm/trunk/engines/scumm/smush/smush_player.cpp	2008-09-01 20:20:20 UTC (rev 34253)
@@ -1258,7 +1258,7 @@
 		}
 		if (_endOfFile)
 			break;
-		if (_vm->_quit || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
+		if (_vm->quit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
 			_smixer->stop();
 			_vm->_mixer->stopHandle(_compressedFileSoundHandle);
 			_vm->_mixer->stopHandle(_IACTchannel);


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