From bcb067698efe6e18be02a23eb48499ed8e0e714f Mon Sep 17 00:00:00 2001 From: Bendegúz Nagy Date: Thu, 18 Aug 2016 17:50:56 +0200 Subject: DM: Add support for loading from launcher --- engines/dm/dm.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'engines/dm/dm.cpp') diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index e22a41dee6..655fb09c4f 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -25,6 +25,7 @@ * maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/) */ +#include "common/config-manager.h" #include "common/scummsys.h" #include "common/system.h" @@ -262,11 +263,17 @@ void DMEngine::f463_initializeGame() { _textMan->f54_textInitialize(); _objectMan->loadObjectNames(); _eventMan->initMouse(); + + int16 saveSlot = 1; do { - f441_processEntrance(); - if (_engineShouldQuit) - return; - } while (f435_loadgame(1) != k1_LoadgameSuccess); + if (ConfMan.hasKey("save_slot")) { + saveSlot = ConfMan.getInt("save_slot"); + } else { + f441_processEntrance(); + if (_engineShouldQuit) + return; + } + } while (f435_loadgame(saveSlot) != k1_LoadgameSuccess); _displayMan->f466_loadIntoBitmap(k11_MenuSpellAreLinesIndice, _menuMan->_gK73_bitmapSpellAreaLines); // @ F0396_MENUS_LoadSpellAreaLinesBitmap -- cgit v1.2.3