AGOS: Improve the quick load/save code.
This commit is contained in:
parent
ab3b052c6f
commit
61af435d8a
2 changed files with 32 additions and 18 deletions
|
@ -467,10 +467,6 @@ void AGOSEngine::delay(uint amount) {
|
||||||
memset(_saveLoadName, 0, sizeof(_saveLoadName));
|
memset(_saveLoadName, 0, sizeof(_saveLoadName));
|
||||||
sprintf(_saveLoadName, "Quick %d", _saveLoadSlot);
|
sprintf(_saveLoadName, "Quick %d", _saveLoadSlot);
|
||||||
_saveLoadType = (event.kbd.hasFlags(Common::KBD_ALT)) ? 1 : 2;
|
_saveLoadType = (event.kbd.hasFlags(Common::KBD_ALT)) ? 1 : 2;
|
||||||
|
|
||||||
// We should only allow a load or save when it was possible in original
|
|
||||||
// This stops load/save during copy protection, conversations and cut scenes
|
|
||||||
if (!_mouseHideCount && !_showPreposition)
|
|
||||||
quickLoadOrSave();
|
quickLoadOrSave();
|
||||||
} else if (event.kbd.hasFlags(Common::KBD_CTRL)) {
|
} else if (event.kbd.hasFlags(Common::KBD_CTRL)) {
|
||||||
if (event.kbd.keycode == Common::KEYCODE_a) {
|
if (event.kbd.keycode == Common::KEYCODE_a) {
|
||||||
|
|
|
@ -142,23 +142,41 @@ void AGOSEngine_Feeble::quickLoadOrSave() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The function uses segments of code from the original game scripts
|
||||||
|
// to allow quick loading and saving, but isn't perfect.
|
||||||
|
//
|
||||||
|
// Unfortuntely this allows loading and saving in locations,
|
||||||
|
// which aren't supported, and will not restore correctly:
|
||||||
|
// Various locations in Elvira 1/2 and Waxworks where saving
|
||||||
|
// was disabled
|
||||||
void AGOSEngine::quickLoadOrSave() {
|
void AGOSEngine::quickLoadOrSave() {
|
||||||
// The function uses segments of code from the original game scripts
|
|
||||||
// to allow quick loading and saving, but isn't perfect.
|
|
||||||
//
|
|
||||||
// Unfortuntely this allows loading and saving in locations,
|
|
||||||
// which aren't supported, and will not restore correctly:
|
|
||||||
// Any overhead maps in Simon the Sorcerer 2
|
|
||||||
// Various locations in Elvira 1/2 and Waxworks where saving
|
|
||||||
// was disabled
|
|
||||||
|
|
||||||
// The floppy disk demo of Simon the Sorcerer 1 doesn't work.
|
|
||||||
if (getFeatures() & GF_DEMO)
|
|
||||||
return;
|
|
||||||
|
|
||||||
bool success;
|
bool success;
|
||||||
Common::String buf;
|
Common::String buf;
|
||||||
|
|
||||||
|
// Disable loading and saving when it was not possible in the original:
|
||||||
|
// In overhead maps areas in Simon the Sorcerer 2
|
||||||
|
// In the floppy disk demo of Simon the Sorcerer 1
|
||||||
|
// In copy protection, conversations and cut scenes
|
||||||
|
if ((getGameType() == GType_SIMON2 && _boxStarHeight == 200) ||
|
||||||
|
(getGameType() == GType_SIMON1 && (getFeatures() & GF_DEMO)) ||
|
||||||
|
_mouseHideCount || _showPreposition) {
|
||||||
|
buf = Common::String::format("Quick load or save game isn't supported in this location");
|
||||||
|
GUI::MessageDialog dialog(buf, "OK");
|
||||||
|
dialog.runModal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if Simon is walking, and stop when required
|
||||||
|
if (getGameType() == GType_SIMON1 && getBitFlag(11)) {
|
||||||
|
vcStopAnimation(11, 1122);
|
||||||
|
animate(4, 11, 1122, 0, 0, 2);
|
||||||
|
waitForSync(1122);
|
||||||
|
} else if (getGameType() == GType_SIMON2 && getBitFlag(11)) {
|
||||||
|
vcStopAnimation(11, 232);
|
||||||
|
animate(4, 11, 232, 0, 0, 2);
|
||||||
|
waitForSync(1122);
|
||||||
|
}
|
||||||
|
|
||||||
char *filename = genSaveName(_saveLoadSlot);
|
char *filename = genSaveName(_saveLoadSlot);
|
||||||
if (_saveLoadType == 2) {
|
if (_saveLoadType == 2) {
|
||||||
Subroutine *sub;
|
Subroutine *sub;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue