From e15f40978a6904dec7a50cfefbb2a05c454c6c74 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 4 Jul 2014 19:07:38 +0200 Subject: CGE2: Implement loading from the Launcher. --- engines/cge2/cge2_main.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'engines/cge2/cge2_main.cpp') diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 77df792e94..b9787b07e1 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -696,11 +696,13 @@ void CGE2Engine::runGame() { } void CGE2Engine::loadUser() { - warning("STUB: CGE2Engine::loadUser()"); - // Missing loading from file. TODO: Implement it with the saving/loading! - loadScript("CGE.INI"); - loadHeroes(); loadPos(); + if (_startGameSlot != -1) + loadGame(_startGameSlot); + else { + loadScript("CGE.INI"); + loadHeroes(); + } } void CGE2Engine::loadHeroes() { // Original name: loadGame() @@ -847,7 +849,11 @@ void CGE2Engine::cge2_main() { loadTab(); - _mode++; + if (_startGameSlot != -1) { + // Starting up a savegame from the launcher + _mode++; + runGame(); + } if (showTitle("WELCOME")) { #if 0 @@ -900,6 +906,8 @@ int CGE2Engine::newRandom(int range) { bool CGE2Engine::showTitle(const char *name) { if (_quitFlag) return false; + + _mode++; _bitmapPalette = _vga->_sysPal; BitmapPtr LB = new Bitmap[1]; -- cgit v1.2.3