diff options
author | Eugene Sandulenko | 2014-04-28 08:18:10 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-28 08:18:10 +0300 |
commit | 5a966eef390ef6d8e56bd5afa42ab6871b484417 (patch) | |
tree | a202f8b08dd1a7bd9492427bb2a81fcc0b0c0ce9 | |
parent | 277a712f0b6835a54c2ee9373b06ff6db42eb7f9 (diff) | |
download | scummvm-rg350-5a966eef390ef6d8e56bd5afa42ab6871b484417.tar.gz scummvm-rg350-5a966eef390ef6d8e56bd5afa42ab6871b484417.tar.bz2 scummvm-rg350-5a966eef390ef6d8e56bd5afa42ab6871b484417.zip |
FULLPIPE: Implement ModalSaveGame::init()
-rw-r--r-- | engines/fullpipe/modal.cpp | 41 | ||||
-rw-r--r-- | engines/fullpipe/modal.h | 2 |
2 files changed, 42 insertions, 1 deletions
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 36dd0066df..459c714984 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1484,6 +1484,47 @@ void ModalSaveGame::processKey(int key) { _queryRes = 0; } +bool ModalSaveGame::init(int counterdiff) { + if (_queryDlg) { + if (!_queryDlg->init(counterdiff)) { + if (!_queryDlg->getQueryResult()) + _queryRes = -1; + + delete _queryDlg; + _queryDlg = 0; + } + + return true; + } + + if (_queryRes == -1) + return true; + + g_fp->_sceneRect = _rect; + + if (g_fp->_currentScene) { + g_fp->_currentScene->_x = _oldBgX; + g_fp->_currentScene->_y = _oldBgY; + } + + if (!_queryRes) { + ModalMainMenu *m = new ModalMainMenu; + + g_fp->_modalObject = m; + + m->_parentObj = _parentObj; + m->_screct = _rect; + m->_bgX = _oldBgX; + m->_bgY = _oldBgY; + + delete this; + + return true; + } + + return false; +} + void ModalSaveGame::setup(Scene *sc, int mode) { warning("STUB: ModalSaveGame::setup()"); } diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index bd6cc18ac1..e2962ab595 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -244,7 +244,7 @@ public: virtual bool pollEvent() { return true; } virtual bool handleMessage(ExCommand *message) { return false; } - virtual bool init(int counterdiff) { return true; } + virtual bool init(int counterdiff); virtual void update() {} virtual void saveload() {} |