[Scummvm-cvs-logs] SF.net SVN: scummvm:[35344] scummvm/trunk/engines/touche
cyx at users.sourceforge.net
cyx at users.sourceforge.net
Sat Dec 13 20:35:33 CET 2008
Revision: 35344
http://scummvm.svn.sourceforge.net/scummvm/?rev=35344&view=rev
Author: cyx
Date: 2008-12-13 19:35:33 +0000 (Sat, 13 Dec 2008)
Log Message:
-----------
disable GMM save/load when original quit/options dialogs is displayed
Modified Paths:
--------------
scummvm/trunk/engines/touche/menu.cpp
scummvm/trunk/engines/touche/touche.cpp
scummvm/trunk/engines/touche/touche.h
Modified: scummvm/trunk/engines/touche/menu.cpp
===================================================================
--- scummvm/trunk/engines/touche/menu.cpp 2008-12-13 17:52:37 UTC (rev 35343)
+++ scummvm/trunk/engines/touche/menu.cpp 2008-12-13 19:35:33 UTC (rev 35344)
@@ -359,6 +359,7 @@
void ToucheEngine::handleOptions(int forceDisplay) {
if (_disabledInputCounter == 0 || forceDisplay != 0) {
setDefaultCursor(_currentKeyCharNum);
+ _gameState = kGameStateOptionsDialog;
MenuData menuData;
memset(&menuData, 0, sizeof(MenuData));
menuData.quit = false;
@@ -440,6 +441,7 @@
if (displayQuitDialog())
quitGame();
}
+ _gameState = kGameStateGameLoop;
}
}
@@ -552,6 +554,7 @@
int ToucheEngine::displayQuitDialog() {
debug(kDebugMenu, "ToucheEngine::displayQuitDialog()");
+ _gameState = kGameStateQuitDialog;
_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
printStatusString(getString(-85));
int ret = 0;
@@ -605,6 +608,7 @@
_system->updateScreen();
}
clearStatusString();
+ _gameState = kGameStateGameLoop;
_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
return ret;
}
Modified: scummvm/trunk/engines/touche/touche.cpp
===================================================================
--- scummvm/trunk/engines/touche/touche.cpp 2008-12-13 17:52:37 UTC (rev 35343)
+++ scummvm/trunk/engines/touche/touche.cpp 2008-12-13 19:35:33 UTC (rev 35344)
@@ -114,6 +114,7 @@
void ToucheEngine::restart() {
_midiPlayer->stop();
+ _gameState = kGameStateGameLoop;
_displayQuitDialog = false;
memset(_flagsTable, 0, sizeof(_flagsTable));
@@ -237,7 +238,7 @@
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
}
-
+
void ToucheEngine::mainLoop() {
restart();
@@ -301,8 +302,9 @@
_flagsTable[600] = event.kbd.keycode;
if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
if (_displayQuitDialog) {
- if (displayQuitDialog())
+ if (displayQuitDialog()) {
quitGame();
+ }
}
} else if (event.kbd.keycode == Common::KEYCODE_F5) {
if (_flagsTable[618] == 0 && !_hideInventoryTexts) {
@@ -3283,12 +3285,12 @@
_system->setPalette(_paletteBuffer, 0, 256);
}
-bool ToucheEngine::canLoadGameStateCurrently() {
- return (_flagsTable[618] == 0 && !_hideInventoryTexts);
+bool ToucheEngine::canLoadGameStateCurrently() {
+ return _gameState == kGameStateGameLoop && _flagsTable[618] == 0 && !_hideInventoryTexts;
}
-bool ToucheEngine::canSaveGameStateCurrently() {
- return (_flagsTable[618] == 0 && !_hideInventoryTexts);
+bool ToucheEngine::canSaveGameStateCurrently() {
+ return _gameState == kGameStateGameLoop && _flagsTable[618] == 0 && !_hideInventoryTexts;
}
} // namespace Touche
Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h 2008-12-13 17:52:37 UTC (rev 35343)
+++ scummvm/trunk/engines/touche/touche.h 2008-12-13 19:35:33 UTC (rev 35344)
@@ -340,6 +340,12 @@
Common::String generateGameStateFileName(const char *target, int slot, bool prefixOnly = false);
int getGameStateFileSlot(const char *filename);
+enum GameState {
+ kGameStateGameLoop,
+ kGameStateOptionsDialog,
+ kGameStateQuitDialog
+};
+
class MidiPlayer;
class ToucheEngine: public Engine {
@@ -638,7 +644,7 @@
bool _inp_rightMouseButtonPressed;
int _disabledInputCounter;
bool _hideInventoryTexts;
-
+ GameState _gameState;
bool _displayQuitDialog;
int _saveLoadCurrentPage;
int _saveLoadCurrentSlot;
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