aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-30 10:57:45 -0400
committerPaul Gilbert2014-08-30 10:57:45 -0400
commit949033ea9242f8ce0ae7c6906c8c5d6831929056 (patch)
tree3d9ba143bcfc011124dd54c938ebf6c00a9595aa
parentf12fa2de07694d93a7035875f56f36ed4849275d (diff)
downloadscummvm-rg350-949033ea9242f8ce0ae7c6906c8c5d6831929056.tar.gz
scummvm-rg350-949033ea9242f8ce0ae7c6906c8c5d6831929056.tar.bz2
scummvm-rg350-949033ea9242f8ce0ae7c6906c8c5d6831929056.zip
ACCESS: Implement loading savegames from launcher
-rw-r--r--engines/access/access.cpp8
-rw-r--r--engines/access/access.h1
-rw-r--r--engines/access/amazon/amazon_game.cpp23
3 files changed, 24 insertions, 8 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index a039139f0a..01bb3e3845 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -108,6 +108,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_narateFile = 0;
_txtPages = 0;
_sndSubFile = 0;
+ _loadSaveSlot = -1;
}
AccessEngine::~AccessEngine() {
@@ -173,6 +174,13 @@ void AccessEngine::initialize() {
_buffer1.create(g_system->getWidth() + TILE_WIDTH, g_system->getHeight());
_buffer2.create(g_system->getWidth(), g_system->getHeight());
+
+ // If requested, load a savegame instead of showing the intro
+ if (ConfMan.hasKey("save_slot")) {
+ int saveSlot = ConfMan.getInt("save_slot");
+ if (saveSlot >= 0 && saveSlot <= 999)
+ _loadSaveSlot = saveSlot;
+ }
}
Common::Error AccessEngine::run() {
diff --git a/engines/access/access.h b/engines/access/access.h
index 8e7c42f959..2f557df7f8 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -106,6 +106,7 @@ private:
protected:
const AccessGameDescription *_gameDescription;
Common::RandomSource _randomSource;
+ int _loadSaveSlot;
/**
* Main handler for showing game rooms
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index 0ccaae85dc..ecd9922f78 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -64,10 +64,16 @@ AmazonEngine::~AmazonEngine() {
}
void AmazonEngine::playGame() {
- // Do introduction
- doIntroduction();
- if (shouldQuit())
- return;
+ // Initialise Amazon game-specific objects
+ _room = new AmazonRoom(this);
+ _scripts = new AmazonScripts(this);
+
+ if (_loadSaveSlot != -1) {
+ // Do introduction
+ doIntroduction();
+ if (shouldQuit())
+ return;
+ }
// Setup the game
setupGame();
@@ -75,12 +81,13 @@ void AmazonEngine::playGame() {
_screen->clearScreen();
_screen->setPanel(0);
_screen->forceFadeOut();
-
_events->showCursor();
- // Setup and execute the room
- _room = new AmazonRoom(this);
- _scripts = new AmazonScripts(this);
+ // If there's a pending savegame to load, load it
+ if (_loadSaveSlot != -1)
+ loadGameState(_loadSaveSlot);
+
+ // Execute the room
_room->doRoom();
}