aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-05-18 18:23:37 -0400
committerMatthew Hoops2011-05-18 18:23:37 -0400
commitd4c92983920cfe3b25a22d91e12c750e591b917e (patch)
treec0b63318b9ba0e67528337cfaa21515def1c3962 /engines/mohawk/myst.cpp
parent7e2edf16b3e2bf1d2b31999979a60802514df6cb (diff)
parentcf107e24be28c7e6db65b5c7ffed120af4a7994b (diff)
downloadscummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.tar.gz
scummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.tar.bz2
scummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r--engines/mohawk/myst.cpp84
1 files changed, 69 insertions, 15 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 655a38b578..4f9c3a893e 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "common/config-manager.h"
@@ -74,7 +71,8 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription
// original, including bugs, missing bits etc. :)
_tweaksEnabled = true;
- _currentCursor = _mainCursor = kDefaultMystCursor;
+ _currentCursor = 0;
+ _mainCursor = kDefaultMystCursor;
_showResourceRects = false;
_curCard = 0;
_needsUpdate = false;
@@ -258,7 +256,10 @@ Common::Error MohawkEngine_Myst::run() {
_loadDialog->setSaveMode(false);
_optionsDialog = new MystOptionsDialog(this);
_cursor = new MystCursorManager(this);
- _rnd = new Common::RandomSource();
+ _rnd = new Common::RandomSource("myst");
+
+ // Cursor is visible by default
+ _cursor->showCursor();
// Load game from launcher/command line if requested
if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) {
@@ -288,9 +289,6 @@ Common::Error MohawkEngine_Myst::run() {
// Test Load Function...
loadHelp(10000);
- // Set the cursor
- _cursor->setCursor(_currentCursor);
-
Common::Event event;
while (!shouldQuit()) {
// Update any background videos
@@ -343,7 +341,20 @@ Common::Error MohawkEngine_Myst::run() {
drawResourceRects();
break;
case Common::KEYCODE_F5:
+ _needsPageDrop = false;
+ _needsShowMap = false;
+
runDialog(*_optionsDialog);
+
+ if (_needsPageDrop) {
+ dropPage();
+ _needsPageDrop = false;
+ }
+
+ if (_needsShowMap) {
+ _scriptParser->showMap();
+ _needsShowMap = false;
+ }
break;
default:
break;
@@ -405,6 +416,11 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS
_curStack = stack;
+ // Fill screen with black and empty cursor
+ _cursor->setCursor(0);
+ _system->fillScreen(_system->getScreenFormat().RGBToColor(0, 0, 0));
+ _system->updateScreen();
+
_sound->stopSound();
_sound->stopBackgroundMyst();
if (linkSrcSound)
@@ -553,7 +569,7 @@ uint16 MohawkEngine_Myst::getCardBackgroundId() {
}
void MohawkEngine_Myst::drawCardBackground() {
- _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 333));
+ _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 332));
}
void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) {
@@ -631,18 +647,18 @@ void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) {
// TODO: Handle Script Resources
- // Make sure we have the right cursor showing
- _dragResource = 0;
- _hoverResource = 0;
- _curResource = -1;
- checkCurrentResource();
-
// Make sure the screen is updated
if (updateScreen) {
_gfx->copyBackBufferToScreen(Common::Rect(544, 333));
_system->updateScreen();
}
+ // Make sure we have the right cursor showing
+ _dragResource = 0;
+ _hoverResource = 0;
+ _curResource = -1;
+ checkCurrentResource();
+
// Debug: Show resource rects
if (_showResourceRects)
drawResourceRects();
@@ -1181,4 +1197,42 @@ 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;
+
+ // Play drop page sound
+ _sound->replaceSoundMyst(800);
+
+ // 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