From dbfe4972e3a3e1d59aee8993697028cdd2de8da2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 18 Oct 2014 11:55:30 -0400 Subject: MADS: Remove deprecated code from AnimationView and a bunch of out-of-date TODOs --- engines/mads/game.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index b544eff2db..63a7e40d1b 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -433,8 +433,6 @@ void Game::handleKeypress(const Common::Event &event) { default: break; } - - warning("TODO: handleKeypress - %d", (int)event.kbd.keycode); } void Game::synchronize(Common::Serializer &s, bool phase1) { -- cgit v1.2.3 From 01e8286e1c8df605c98f828e5834584c997713b4 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 28 Oct 2014 16:19:26 +0200 Subject: MADS: Remove trailing whitespace --- engines/mads/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 63a7e40d1b..94653f9a39 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -556,7 +556,7 @@ void Game::writeSavegameHeader(Common::OutSaveFile *out, MADSSavegameHeader &hea if (!_saveThumb) createThumbnail(); Graphics::saveThumbnail(*out, *_saveThumb); - + _saveThumb->free(); delete _saveThumb; _saveThumb = nullptr; -- cgit v1.2.3 From 926404bd10309e98d353acd5515c678234de28aa Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Jan 2015 20:51:52 -0500 Subject: MADS: Renamings of Layer and a transition type --- engines/mads/game.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 94653f9a39..0ce24daf7a 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -240,7 +240,7 @@ void Game::sectionLoop() { _fx = kTransitionFadeOutIn; break; case SCREEN_FADE_FAST: - _fx = kCenterVertTransition; + _fx = kNullPaletteCopy; break; default: _fx = kTransitionNone; @@ -324,7 +324,7 @@ void Game::initSection(int sectionNumber) { _vm->_palette->resetGamePalette(18, 10); _vm->_palette->setLowRange(); - if (_scene._layer == LAYER_GUI) + if (_scene._mode == SCREENMODE_VGA) _vm->_palette->setPalette(_vm->_palette->_mainPalette, 0, 4); _vm->_events->loadCursors("*CURSOR.SS"); -- cgit v1.2.3 From d31e602add7e5466754d4b651ce7f947f6effdda Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Feb 2015 16:54:47 -0500 Subject: MADS: Allow Escape key to close game options dialog --- engines/mads/game.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 0ce24daf7a..27691d3380 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -403,12 +403,12 @@ Common::StringArray Game::getMessage(uint32 id) { static const char *const DEBUG_STRING = "WIDEPIPE"; -void Game::handleKeypress(const Common::Event &event) { - if (event.kbd.flags & Common::KBD_CTRL) { +void Game::handleKeypress(const Common::KeyState &kbd) { + if (kbd.flags & Common::KBD_CTRL) { if (_widepipeCtr == 8) { // Implement original game cheating keys here someday } else { - if (event.kbd.keycode == (Common::KEYCODE_a + + if (kbd.keycode == (Common::KEYCODE_a + (DEBUG_STRING[_widepipeCtr] - 'a'))) { if (++_widepipeCtr == 8) { MessageDialog *dlg = new MessageDialog(_vm, 2, @@ -420,7 +420,7 @@ void Game::handleKeypress(const Common::Event &event) { } } - switch (event.kbd.keycode) { + switch (kbd.keycode) { case Common::KEYCODE_F1: _vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU; break; -- cgit v1.2.3 From 076ce7e6c158878305ace5d7f334d54f8d44e966 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Feb 2015 17:45:20 -0500 Subject: MADS: Implement scroll wheel support for scrolling inventory --- engines/mads/game.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 27691d3380..3b8b053fec 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -420,6 +420,7 @@ void Game::handleKeypress(const Common::KeyState &kbd) { } } + Scene &scene = _vm->_game->_scene; switch (kbd.keycode) { case Common::KEYCODE_F1: _vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU; @@ -430,6 +431,16 @@ void Game::handleKeypress(const Common::KeyState &kbd) { case Common::KEYCODE_F7: _vm->_dialogs->_pendingDialog = DIALOG_RESTORE; break; + case Common::KEYCODE_PAGEUP: + scene._userInterface._scrollbarStrokeType = SCROLLBAR_UP; + scene._userInterface.changeScrollBar(); + break; + case Common::KEYCODE_PAGEDOWN: + scene._userInterface._scrollbarStrokeType = SCROLLBAR_DOWN; + scene._userInterface.changeScrollBar(); + break; + + default: break; } -- cgit v1.2.3 From c80c74e49926daed108f73e115fda7ba5901eb61 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:01:07 -0500 Subject: MADS: Refactoring of text/animation views to show outside game loop --- engines/mads/game.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 3b8b053fec..74c2a3f416 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -105,8 +105,6 @@ Game::~Game() { } void Game::run() { - initializeGlobals(); - // If requested, load a savegame instead of showing the intro if (ConfMan.hasKey("save_slot")) { int saveSlot = ConfMan.getInt("save_slot"); @@ -116,15 +114,19 @@ void Game::run() { _statusFlag = true; - if (_loadGameSlot == -1) { - startGame(); - } + while (!_vm->shouldQuit()) { + initializeGlobals(); - // Get the initial starting time for the first scene - _scene._frameStartTime = _vm->_events->getFrameCounter(); + if (_loadGameSlot == -1) { + startGame(); + } + + // Get the initial starting time for the first scene + _scene._frameStartTime = _vm->_events->getFrameCounter(); - if (!_vm->shouldQuit()) - gameLoop(); + if (!_vm->shouldQuit()) + gameLoop(); + } } void Game::splitQuote(const Common::String &source, Common::String &line1, Common::String &line2) { @@ -140,7 +142,7 @@ void Game::splitQuote(const Common::String &source, Common::String &line1, Commo } void Game::gameLoop() { - while (!_vm->shouldQuit() && _statusFlag) { + while (!_vm->shouldQuit() && _statusFlag && !_winStatus) { if (_loadGameSlot != -1) { loadGame(_loadGameSlot); _loadGameSlot = -1; @@ -168,7 +170,8 @@ void Game::gameLoop() { } void Game::sectionLoop() { - while (!_vm->shouldQuit() && _statusFlag && (_sectionNumber == _currentSectionNumber)) { + while (!_vm->shouldQuit() && _statusFlag && !_winStatus && + (_sectionNumber == _currentSectionNumber)) { _kernelMode = KERNEL_ROOM_PRELOAD; _player._spritesChanged = true; _quoteEmergency = false; -- cgit v1.2.3 From 0f02cdb4aa0a0e29bea414583a6db8a5ae389f49 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 10:11:19 -0400 Subject: MADS: Fix crash in stream crossing death, simplify SpriteSets class --- engines/mads/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 74c2a3f416..b601a12c82 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -160,7 +160,7 @@ void Game::gameLoop() { sectionLoop(); _player.releasePlayerSprites(); - assert(_scene._sprites._assetCount == 0); + assert(_scene._sprites.size() == 0); _vm->_palette->unlock(); _vm->_events->waitCursor(); -- cgit v1.2.3 From d9168c8fae304c0984b59d142dfc66e04b9fab36 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Apr 2015 15:28:10 -0500 Subject: MADS: Fix placement of blowgun in easy mode --- engines/mads/game.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index b601a12c82..72d7988c05 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -115,8 +115,6 @@ void Game::run() { _statusFlag = true; while (!_vm->shouldQuit()) { - initializeGlobals(); - if (_loadGameSlot == -1) { startGame(); } -- cgit v1.2.3 From ec999f1cb74dff8c42c69898bb6cbc3823b169dd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 9 Apr 2015 13:44:39 +0300 Subject: MADS: Plug some memory leaks Surfaces should be freed (to free their inner allocated surface buffers) before being deleted --- engines/mads/game.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 72d7988c05..3d1c194612 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -100,6 +100,7 @@ Game::~Game() { } delete _saveFile; + _surface->free(); delete _surface; delete _sectionHandler; } -- cgit v1.2.3 From 5dd69b4dd1be1dd8793111df089a4c737231a614 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 9 May 2015 15:56:27 +0200 Subject: MADS: Make GPL header consistent with what we normally use. --- engines/mads/game.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.cpp') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 3d1c194612..91f6cd5630 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3