diff options
author | Paul Gilbert | 2011-12-17 13:28:12 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-12-17 13:28:12 +1100 |
commit | 3e6e5bc0ce1d384d96b464377319ecae0a36222e (patch) | |
tree | c29db8a29696f175f85c2d88261e9d3533614a0f /engines/tsage | |
parent | 24740b30bd9d6cfd5ce420951a53b87a156ffbbf (diff) | |
download | scummvm-rg350-3e6e5bc0ce1d384d96b464377319ecae0a36222e.tar.gz scummvm-rg350-3e6e5bc0ce1d384d96b464377319ecae0a36222e.tar.bz2 scummvm-rg350-3e6e5bc0ce1d384d96b464377319ecae0a36222e.zip |
TSAGE: Bugfix to allow loading savegames in Blue Force directly from the launcher
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 9888f4dd91..91cba43e1d 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -20,6 +20,7 @@ * */ +#include "common/config-manager.h" #include "tsage/blue_force/blueforce_logic.h" #include "tsage/blue_force/blueforce_dialogs.h" #include "tsage/blue_force/blueforce_scenes0.h" @@ -42,8 +43,25 @@ namespace TsAGE { namespace BlueForce { void BlueForceGame::start() { - // Start the game - g_globals->_sceneManager.changeScene(20); + int slot = -1; + + // Check for a savegame to load straight from the launcher + if (ConfMan.hasKey("save_slot")) { + slot = ConfMan.getInt("save_slot"); + Common::String file = g_vm->generateSaveName(slot); + Common::InSaveFile *in = g_vm->_system->getSavefileManager()->openForLoading(file); + if (in) + delete in; + else + slot = -1; + } + + if (slot >= 0) + // Set the savegame slot to load in the main loop + g_globals->_sceneHandler->_loadGameSlot = slot; + else + // Switch to the title screen + g_globals->_sceneManager.setNewScene(20); } Scene *BlueForceGame::createScene(int sceneNumber) { |