aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-03 17:20:01 +0200
committerEugene Sandulenko2019-09-03 17:17:09 +0200
commitc3c8299962aaa335d4acb4ae39b772accf3cfff1 (patch)
tree739938d46118798e6d497cd43044813a97677cb8 /engines
parent74eb242b5a0606a274b38e1fdc12b9b8fb908368 (diff)
downloadscummvm-rg350-c3c8299962aaa335d4acb4ae39b772accf3cfff1.tar.gz
scummvm-rg350-c3c8299962aaa335d4acb4ae39b772accf3cfff1.tar.bz2
scummvm-rg350-c3c8299962aaa335d4acb4ae39b772accf3cfff1.zip
HDB: Completed rendering pipeline
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/hdb.cpp58
-rw-r--r--engines/hdb/hdb.h31
-rw-r--r--engines/hdb/menu.cpp10
-rw-r--r--engines/hdb/menu.h2
4 files changed, 78 insertions, 23 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
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index 573f9534fb..33778b37d2 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -149,13 +149,26 @@ public:
bool init();
- void start();
-
bool restartMap();
bool startMap(char *name);
+ void changeMap(char *name) {
+ strcpy(_changeMapname, name);
+ _changeLevel = true;
+ }
+
bool saveSlot(int slot);
+ void saveWhenReady(int slot) {
+ _saveInfo.active = true;
+ _saveInfo.slot = slot;
+ }
+
+ void loadWhenReady(int slot) {
+ _loadInfo.active = true;
+ _loadInfo.slot = slot;
+ }
+
void setGameState(GameState gs) {
_gameState = gs;
}
@@ -200,6 +213,11 @@ public:
char *lastMapname() { return _lastMapname; }
+ void changeLevel(char *name) {
+ strcpy(_changeMapname, name);
+ _changeLevel = true;
+ }
+
//
// monkeystone secret stars
//
@@ -239,6 +257,15 @@ private:
int32 _monkeystone14;
int32 _monkeystone21;
+ bool _changeLevel;
+ char _changeMapname[64];
+
+ struct {
+ bool active;
+ int slot;
+ } _saveInfo, _loadInfo;
+
+
};
extern HDBGame *g_hdb;
diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp
index 73c0eac8fc..4b65a8ba60 100644
--- a/engines/hdb/menu.cpp
+++ b/engines/hdb/menu.cpp
@@ -33,6 +33,16 @@ bool Menu::init() {
return true;
}
+void Menu::startTitle() {
+ // REMOVE: Putting this here since Menu hasn't been implemented yet.
+ // Defaults the game into Action Mode
+ g_hdb->setActionMode(1);
+ g_hdb->setGameState(GAME_PLAY);
+
+ warning("STUB: Menu::startTitle()");
+
+}
+
void Menu::fillSavegameSlots() {
warning("STUB: PMenu::fillSavegameSlots()");
}
diff --git a/engines/hdb/menu.h b/engines/hdb/menu.h
index 73e5a80a30..ebf1e5a5ff 100644
--- a/engines/hdb/menu.h
+++ b/engines/hdb/menu.h
@@ -37,6 +37,8 @@ public:
bool init();
+ void startTitle();
+
void fillSavegameSlots();
int _starWarp;