From c7f3a4f578b86b54572500322cc55cf0893634c9 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 14 May 2011 19:26:33 +0200 Subject: MOHAWK: Implement page drop button for Myst --- engines/mohawk/myst.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'engines/mohawk/myst.cpp') diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 44bfd16e12..4ee078cfc1 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -340,7 +340,13 @@ Common::Error MohawkEngine_Myst::run() { drawResourceRects(); break; case Common::KEYCODE_F5: + _needsPageDrop = false; runDialog(*_optionsDialog); + + if (_needsPageDrop) { + dropPage(); + _needsPageDrop = false; + } break; default: break; @@ -1178,4 +1184,39 @@ bool MohawkEngine_Myst::canSaveGameStateCurrently() { return false; } +void MohawkEngine_Myst::dropPage() { + uint16 page = _gameState->_globals.heldPage; + bool whitePage = page == 13; + bool bluePage = page - 1 < 6; + bool redPage = page - 7 < 6; + + // Drop page + _gameState->_globals.heldPage = 0; + + // Redraw page area + if (whitePage && _gameState->_globals.currentAge == 2) { + redrawArea(41); + } else if (bluePage) { + if (page == 6) { + if (_gameState->_globals.currentAge == 2) + redrawArea(24); + } else { + redrawArea(103); + } + } else if (redPage) { + if (page == 12) { + if (_gameState->_globals.currentAge == 2) + redrawArea(25); + } else if (page == 10) { + if (_gameState->_globals.currentAge == 1) + redrawArea(35); + } else { + redrawArea(102); + } + } + + setMainCursor(kDefaultMystCursor); + checkCursorHints(); +} + } // End of namespace Mohawk -- cgit v1.2.3