diff options
author | Eugene Sandulenko | 2019-07-03 17:20:01 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:09 +0200 |
commit | c3c8299962aaa335d4acb4ae39b772accf3cfff1 (patch) | |
tree | 739938d46118798e6d497cd43044813a97677cb8 /engines/hdb/hdb.cpp | |
parent | 74eb242b5a0606a274b38e1fdc12b9b8fb908368 (diff) | |
download | scummvm-rg350-c3c8299962aaa335d4acb4ae39b772accf3cfff1.tar.gz scummvm-rg350-c3c8299962aaa335d4acb4ae39b772accf3cfff1.tar.bz2 scummvm-rg350-c3c8299962aaa335d4acb4ae39b772accf3cfff1.zip |
HDB: Completed rendering pipeline
Diffstat (limited to 'engines/hdb/hdb.cpp')
-rw-r--r-- | engines/hdb/hdb.cpp | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index fdbacecb2f..3fefb2835b 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -55,6 +55,7 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst _rnd = new Common::RandomSource("hdb"); _currentMapname[0] = _currentLuaName[0] = 0; + _lastMapname[0] = _lastLuaName[0] = 0; _monkeystone7 = STARS_MONKEYSTONE_7_FAKE; _monkeystone14 = STARS_MONKEYSTONE_14_FAKE; @@ -84,8 +85,6 @@ bool HDBGame::init() { Game Subsystem Initializations */ - _lastMapname[0] = 0; - // Init fileMan if (!_fileMan->openMPC(getGameFile())) { @@ -94,27 +93,30 @@ bool HDBGame::init() { if (!_gfx->init()) { error("Gfx::init: Couldn't initialize Gfx"); } - if (!_input->init()) { - error("Input::init: Couldn't initialize Input"); + if (!_sound->init()) { + error("Window::init: Couldn't initialize Sound"); } if (!_ai->init()) { error("AI::init: Couldn't initialize AI"); } - if (!_lua->init()) { - error("LuaScript::init: Couldn't load the GLOBAL_LUA code."); - } - if (!_sound->init()) { - error("Window::init: Couldn't initialize Sound"); - } if (!_window->init()) { error("Window::init: Couldn't initialize Window"); } + if (!_input->init()) { + error("Input::init: Couldn't initialize Input"); + } + if (!_lua->init()) { + error("LuaScript::init: Couldn't load the GLOBAL_LUA code."); + } + + _menu->init(); + + _changeLevel = false; + _changeMapname[0] = 0; + _loadInfo.active = _saveInfo.active = false; - // REMOVE: Putting this here since Menu hasn't been implemented yet. - // Defaults the game into Action Mode - setActionMode(1); + _menu->startTitle(); - start(); _gameShutdown = false; _pauseFlag = 0; _systemInit = true; @@ -122,11 +124,6 @@ bool HDBGame::init() { return true; } -void HDBGame::start() { - warning("REMOVE: _gameState initialized to GAME_PLAY"); - _gameState = GAME_PLAY; -} - /* Changes the current GameState to the next one. Game State Transitions are deterministic: each state can @@ -600,13 +597,32 @@ Common::Error HDBGame::run() { _map->drawForegrounds(); _ai->animateTargets(); - _window->drawDialogChoice(); _window->drawDialog(); - _window->drawMessageBar(); + _window->drawDialogChoice(); _window->drawInventory(); + _window->drawMessageBar(); _window->drawDeliveries(); _window->drawTextOut(); _window->drawPause(); + + //_gfx->drawBonusStars(); + _gfx->drawSnow(); + + if (_changeLevel == true) { + _changeLevel = false; + startMap(_changeMapname); + } + + // + // should we save the game at this point? + // + if (_saveInfo.active == true) { + _sound->playSound(SND_VORTEX_SAVE); + _ai->stopEntity(e); + _menu->fillSavegameSlots(); + saveSlot(_saveInfo.slot); + _saveInfo.active = false; + } } // Update Timer that's NOT used for in-game Timing |