diff options
author | Vincent Bénony | 2016-01-06 16:20:23 +0100 |
---|---|---|
committer | Vincent Bénony | 2016-01-06 16:20:23 +0100 |
commit | efdb5679ce6304dbc854afbbc511e633d7513338 (patch) | |
tree | e680a240e5f6018fc3a4cce53b50060caa22a929 /engines/cine | |
parent | 4687ff6d6d2863cc95c8137543ecf9c39bc01723 (diff) | |
parent | b72c02bad44749a1355acefdb198e36b2e772575 (diff) | |
download | scummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.tar.gz scummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.tar.bz2 scummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.zip |
IOS: Merge branch 'master' into ios-fix
Diffstat (limited to 'engines/cine')
-rw-r--r-- | engines/cine/POTFILES | 1 | ||||
-rw-r--r-- | engines/cine/cine.h | 3 | ||||
-rw-r--r-- | engines/cine/detection.cpp | 20 | ||||
-rw-r--r-- | engines/cine/detection_tables.h | 2 | ||||
-rw-r--r-- | engines/cine/saveload.cpp | 2 | ||||
-rw-r--r-- | engines/cine/various.cpp | 66 |
6 files changed, 89 insertions, 5 deletions
diff --git a/engines/cine/POTFILES b/engines/cine/POTFILES new file mode 100644 index 0000000000..76f76832c3 --- /dev/null +++ b/engines/cine/POTFILES @@ -0,0 +1 @@ +engines/cine/detection.cpp diff --git a/engines/cine/cine.h b/engines/cine/cine.h index 71a0c242b6..7c0191b4d9 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -123,6 +123,7 @@ public: bool loadSaveDirectory(); void makeSystemMenu(); + int scummVMSaveLoadDialog(bool isSave); int modifyGameSpeed(int speedChange); int getTimerDelay() const; Common::Error loadGameState(int slot); @@ -152,7 +153,7 @@ private: bool makeLoad(const Common::String &saveName); void makeSaveFW(Common::OutSaveFile &out); void makeSaveOS(Common::OutSaveFile &out); - void makeSave(char *saveFileName); + void makeSave(const Common::String &saveFileName); void mainLoop(int bootScriptIdx); void readVolCnf(); diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 4202bdc942..40e79f96ac 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -24,8 +24,10 @@ #include "engines/advancedDetector.h" #include "engines/obsolete.h" + #include "common/system.h" #include "common/textconsole.h" +#include "common/translation.h" #include "cine/cine.h" #include "cine/various.h" @@ -61,11 +63,25 @@ static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = { #include "cine/detection_tables.h" +static const ADExtraGuiOptionsMap optionsList[] = { + { + GAMEOPTION_ORIGINAL_SAVELOAD, + { + _s("Use original save/load screens"), + _s("Use the original save/load screens, instead of the ScummVM ones"), + "originalsaveload", + false + } + }, + + AD_EXTRA_GUI_OPTIONS_TERMINATOR +}; + class CineMetaEngine : public AdvancedMetaEngine { public: - CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames) { + CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames, optionsList) { _singleid = "cine"; - _guioptions = GUIO1(GUIO_NOSPEECH); + _guioptions = GUIO2(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVELOAD); } virtual GameDescriptor findGame(const char *gameid) const { diff --git a/engines/cine/detection_tables.h b/engines/cine/detection_tables.h index 1188deb1a6..ca6a8a9168 100644 --- a/engines/cine/detection_tables.h +++ b/engines/cine/detection_tables.h @@ -22,6 +22,8 @@ namespace Cine { +#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1 + static const CINEGameDescription gameDescriptions[] = { { { diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp index 907086a9a1..1f4f286694 100644 --- a/engines/cine/saveload.cpp +++ b/engines/cine/saveload.cpp @@ -969,7 +969,7 @@ void CineEngine::makeSaveOS(Common::OutSaveFile &out) { saveBgIncrustList(out); } -void CineEngine::makeSave(char *saveFileName) { +void CineEngine::makeSave(const Common::String &saveFileName) { Common::SharedPtr<Common::OutSaveFile> fHandle(_saveFileMan->openForSaving(saveFileName)); setMouseCursor(MOUSE_CURSOR_DISK); diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 8687699a44..cd877a3295 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -21,12 +21,16 @@ */ +#include "common/config-manager.h" #include "common/endian.h" #include "common/events.h" #include "common/textconsole.h" +#include "common/translation.h" #include "graphics/cursorman.h" +#include "gui/saveload.h" + #include "cine/cine.h" #include "cine/main_loop.h" #include "cine/object.h" @@ -335,6 +339,55 @@ void CineEngine::resetEngine() { } } +int CineEngine::scummVMSaveLoadDialog(bool isSave) { + GUI::SaveLoadChooser *dialog; + Common::String desc; + int slot; + + if (isSave) { + dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); + + slot = dialog->runModalWithCurrentTarget(); + desc = dialog->getResultString(); + + if (desc.empty()) { + // create our own description for the saved game, the user didnt enter it + desc = dialog->createDefaultSaveDescription(slot); + } + } + else { + dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false); + slot = dialog->runModalWithCurrentTarget(); + } + + delete dialog; + + if (slot < 0) + return true; + + Common::String saveFileName(Common::String::format("%s.%1d", _targetName.c_str(), slot)); + + if (isSave) { + Common::String tmp = Common::String::format("%s.dir", _targetName.c_str()); + + Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(tmp); + if (!fHandle) { + warning("Unable to open file %s for saving", tmp.c_str()); + return false; + } + + Common::strlcpy(currentSaveName[slot], desc.c_str(), 20); + + fHandle->write(currentSaveName, 200); + delete fHandle; + + makeSave(saveFileName); + return true; + } else { + return makeLoad(saveFileName); + } +} + void CineEngine::makeSystemMenu() { int16 numEntry, systemCommand; int16 mouseX, mouseY, mouseButton; @@ -381,7 +434,11 @@ void CineEngine::makeSystemMenu() { } case 4: { // load game if (loadSaveDirectory()) { -// int16 selectedSave; + if (!ConfMan.getBool("originalsaveload")) { + scummVMSaveLoadDialog(false); + inMenu = false; + return; + } getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY); selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180); @@ -417,6 +474,13 @@ void CineEngine::makeSystemMenu() { } case 5: { // Save game loadSaveDirectory(); + + if (!ConfMan.getBool("originalsaveload")) { + scummVMSaveLoadDialog(true); + inMenu = false; + return; + } + selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180); if (selectedSave >= 0) { |