mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-20 16:59:06 +00:00
ACCESS: Implement loading savegames from launcher
This commit is contained in:
parent
f12fa2de07
commit
949033ea92
@ -108,6 +108,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
|
|||||||
_narateFile = 0;
|
_narateFile = 0;
|
||||||
_txtPages = 0;
|
_txtPages = 0;
|
||||||
_sndSubFile = 0;
|
_sndSubFile = 0;
|
||||||
|
_loadSaveSlot = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessEngine::~AccessEngine() {
|
AccessEngine::~AccessEngine() {
|
||||||
@ -173,6 +174,13 @@ void AccessEngine::initialize() {
|
|||||||
|
|
||||||
_buffer1.create(g_system->getWidth() + TILE_WIDTH, g_system->getHeight());
|
_buffer1.create(g_system->getWidth() + TILE_WIDTH, g_system->getHeight());
|
||||||
_buffer2.create(g_system->getWidth(), 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() {
|
Common::Error AccessEngine::run() {
|
||||||
|
@ -106,6 +106,7 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
const AccessGameDescription *_gameDescription;
|
const AccessGameDescription *_gameDescription;
|
||||||
Common::RandomSource _randomSource;
|
Common::RandomSource _randomSource;
|
||||||
|
int _loadSaveSlot;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main handler for showing game rooms
|
* Main handler for showing game rooms
|
||||||
|
@ -64,10 +64,16 @@ AmazonEngine::~AmazonEngine() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AmazonEngine::playGame() {
|
void AmazonEngine::playGame() {
|
||||||
// Do introduction
|
// Initialise Amazon game-specific objects
|
||||||
doIntroduction();
|
_room = new AmazonRoom(this);
|
||||||
if (shouldQuit())
|
_scripts = new AmazonScripts(this);
|
||||||
return;
|
|
||||||
|
if (_loadSaveSlot != -1) {
|
||||||
|
// Do introduction
|
||||||
|
doIntroduction();
|
||||||
|
if (shouldQuit())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Setup the game
|
// Setup the game
|
||||||
setupGame();
|
setupGame();
|
||||||
@ -75,12 +81,13 @@ void AmazonEngine::playGame() {
|
|||||||
_screen->clearScreen();
|
_screen->clearScreen();
|
||||||
_screen->setPanel(0);
|
_screen->setPanel(0);
|
||||||
_screen->forceFadeOut();
|
_screen->forceFadeOut();
|
||||||
|
|
||||||
_events->showCursor();
|
_events->showCursor();
|
||||||
|
|
||||||
// Setup and execute the room
|
// If there's a pending savegame to load, load it
|
||||||
_room = new AmazonRoom(this);
|
if (_loadSaveSlot != -1)
|
||||||
_scripts = new AmazonScripts(this);
|
loadGameState(_loadSaveSlot);
|
||||||
|
|
||||||
|
// Execute the room
|
||||||
_room->doRoom();
|
_room->doRoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user