[Scummvm-cvs-logs] CVS: scummvm/sky control.cpp,1.50,1.51 control.h,1.21,1.22 sky.cpp,1.101,1.102
Robert G?ffringmann
lavosspawn at users.sourceforge.net
Wed Jul 30 19:03:09 CEST 2003
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv18523/sky
Modified Files:
control.cpp control.h sky.cpp
Log Message:
deactivated loading/(auto-)saving at places where it's not allowed
Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- control.cpp 14 Jul 2003 20:01:53 -0000 1.50
+++ control.cpp 31 Jul 2003 01:57:05 -0000 1.51
@@ -506,13 +506,13 @@
return 0;
case REST_GAME_PANEL:
- if (SkyState::_systemVars.systemFlags & SF_CHOOSING)
+ if (!loadSaveAllowed())
return CANCEL_PRESSED; // can't save/restore while choosing
animClick(pButton);
return saveRestorePanel(false); // texts can't be edited
case SAVE_GAME_PANEL:
- if (SkyState::_systemVars.systemFlags & SF_CHOOSING)
+ if (!loadSaveAllowed())
return CANCEL_PRESSED; // can't save/restore while choosing
animClick(pButton);
return saveRestorePanel(true); // texts can be edited
@@ -1035,6 +1035,20 @@
destPos += MAX_TEXT_LEN;
}
}
+}
+
+bool SkyControl::loadSaveAllowed(void) {
+
+ if (SkyState::_systemVars.systemFlags & SF_CHOOSING)
+ return false; // texts get lost during load/save, so don't allow it during choosing
+ if (SkyLogic::_scriptVariables[SCREEN] >= 101)
+ return false; // same problem with LINC terminals
+ if ((SkyLogic::_scriptVariables[SCREEN] >= 82) &&
+ (SkyLogic::_scriptVariables[SCREEN] != 85) &&
+ (SkyLogic::_scriptVariables[SCREEN] < 90))
+ return false; // don't allow saving in final rooms
+
+ return true;
}
void SkyControl::saveDescriptions(uint8 *srcBuf) {
Index: control.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- control.h 12 Jul 2003 05:26:23 -0000 1.21
+++ control.h 31 Jul 2003 01:57:05 -0000 1.22
@@ -174,6 +174,7 @@
void showGameQuitMsg(bool useScreen = true);
void doAutoSave(void);
uint16 quickXRestore(uint16 slot);
+ bool loadSaveAllowed(void);
private:
void initPanel(void);
Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- sky.cpp 29 Jul 2003 21:03:25 -0000 1.101
+++ sky.cpp 31 Jul 2003 01:57:05 -0000 1.102
@@ -205,12 +205,11 @@
delay(_systemVars.gameSpeed);
if (_system->get_msecs() - _lastSaveTime > 5 * 60 * 1000) {
- if (_systemVars.systemFlags & SF_CHOOSING)
- _lastSaveTime += 30 * 1000;
- else {
+ if (_skyControl->loadSaveAllowed()) {
_lastSaveTime = _system->get_msecs();
_skyControl->doAutoSave();
- }
+ } else
+ _lastSaveTime += 30 * 1000; // try again in 30 secs
}
_skySound->checkFxQueue();
_skyMouse->mouseEngine((uint16)_sdl_mouse_x, (uint16)_sdl_mouse_y);
More information about the Scummvm-git-logs
mailing list