[Scummvm-cvs-logs] scummvm master -> 9f05f8805dfda0892b809e268c2c4869ca33d4ff
bgK
bastien.bouclet at gmail.com
Sun May 15 17:44:32 CEST 2011
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d72037fb72 MOHAWK: Play a sound when dropping a page
e0e28aaeb2 MOHAWK: Implement "Show Map" feature for Myst ME
af9dc7a29c MOHAWK: Display a black screen while changing stack. Default to an empty cursor.
9f05f8805d MOHAWK: Fix loading a Myst savegame from the launcher.
Commit: d72037fb72b876b9cc0ca80d585a1a4939a68bd9
https://github.com/scummvm/scummvm/commit/d72037fb72b876b9cc0ca80d585a1a4939a68bd9
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2011-05-15T08:41:54-07:00
Commit Message:
MOHAWK: Play a sound when dropping a page
Changed paths:
engines/mohawk/myst.cpp
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 4ee078c..eedaa24 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -1190,6 +1190,9 @@ void MohawkEngine_Myst::dropPage() {
bool bluePage = page - 1 < 6;
bool redPage = page - 7 < 6;
+ // Play drop page sound
+ _sound->replaceSoundMyst(800);
+
// Drop page
_gameState->_globals.heldPage = 0;
Commit: e0e28aaeb24983b0e0700b5e561f0d9c991bfb4a
https://github.com/scummvm/scummvm/commit/e0e28aaeb24983b0e0700b5e561f0d9c991bfb4a
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2011-05-15T08:41:54-07:00
Commit Message:
MOHAWK: Implement "Show Map" feature for Myst ME
Changed paths:
engines/mohawk/dialogs.cpp
engines/mohawk/dialogs.h
engines/mohawk/myst.cpp
engines/mohawk/myst.h
engines/mohawk/myst_scripts.cpp
engines/mohawk/myst_scripts.h
engines/mohawk/myst_stacks/channelwood.h
engines/mohawk/myst_stacks/mechanical.h
engines/mohawk/myst_stacks/myst.h
engines/mohawk/myst_stacks/selenitic.h
engines/mohawk/myst_stacks/stoneship.h
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index 22a9d2d..6cb4559 100644
--- a/engines/mohawk/dialogs.cpp
+++ b/engines/mohawk/dialogs.cpp
@@ -80,7 +80,8 @@ enum {
kZipCmd = 'ZIPM',
kTransCmd = 'TRAN',
kWaterCmd = 'WATR',
- kDropCmd = 'DROP'
+ kDropCmd = 'DROP',
+ kMapCmd = 'SMAP'
};
#ifdef ENABLE_MYST
@@ -90,6 +91,12 @@ MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog
_transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd);
_dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), 0, kDropCmd);
+ // Myst ME only has maps
+ if (_vm->getFeatures() & GF_ME)
+ _showMapButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("~S~how Map"), 0, kMapCmd);
+ else
+ _showMapButton = 0;
+
new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), 0, GUI::kOKCmd);
new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), 0, GUI::kCloseCmd);
}
@@ -102,6 +109,10 @@ void MystOptionsDialog::open() {
_dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != 0);
+ if (_showMapButton)
+ _showMapButton->setEnabled(_vm->_scriptParser &&
+ _vm->_scriptParser->getMap());
+
_zipModeCheckbox->setState(_vm->_gameState->_globals.zipMode);
_transitionsCheckbox->setState(_vm->_gameState->_globals.transitions);
}
@@ -118,6 +129,10 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui
_vm->_needsPageDrop = true;
close();
break;
+ case kMapCmd:
+ _vm->_needsShowMap = true;
+ close();
+ break;
case GUI::kCloseCmd:
close();
break;
diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h
index 8aa9d0f..853ff30 100644
--- a/engines/mohawk/dialogs.h
+++ b/engines/mohawk/dialogs.h
@@ -82,6 +82,7 @@ private:
GUI::CheckboxWidget *_zipModeCheckbox;
GUI::CheckboxWidget *_transitionsCheckbox;
GUI::ButtonWidget *_dropPageButton;
+ GUI::ButtonWidget *_showMapButton;
};
#endif
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index eedaa24..57d52d8 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -341,12 +341,19 @@ Common::Error MohawkEngine_Myst::run() {
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;
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index e123883..5edf774 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -166,6 +166,7 @@ public:
bool _tweaksEnabled;
bool _needsUpdate;
bool _needsPageDrop;
+ bool _needsShowMap;
MystView _view;
MystGraphics *_gfx;
diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index a635144..be5b7e1 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -145,6 +145,7 @@ void MystScriptParser::setupCommonOpcodes() {
OPCODE(44, o_restoreMainCursor);
// Opcode 45 Not Present
OPCODE(46, o_soundWaitStop);
+ OPCODE(51, o_exitMap);
// Opcodes 47 to 99 Not Present
OPCODE(0xFFFF, NOP);
@@ -922,4 +923,15 @@ void MystScriptParser::o_quit(uint16 op, uint16 var, uint16 argc, uint16 *argv)
_vm->quitGame();
}
+void MystScriptParser::showMap() {
+ if (_vm->getCurCard() != getMap()) {
+ _savedMapCardId = _vm->getCurCard();
+ _vm->changeToCard(getMap(), true);
+ }
+}
+
+void MystScriptParser::o_exitMap(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ _vm->changeToCard(_savedMapCardId, true);
+}
+
} // End of namespace Mohawk
diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h
index c32d6a9..18f5b27 100644
--- a/engines/mohawk/myst_scripts.h
+++ b/engines/mohawk/myst_scripts.h
@@ -76,6 +76,9 @@ public:
virtual void toggleVar(uint16 var);
virtual bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 0; }
+ void showMap();
+
void animatedUpdate(uint16 argc, uint16 *argv, uint16 delay);
DECLARE_OPCODE(unknown);
@@ -119,6 +122,7 @@ public:
DECLARE_OPCODE(o_saveMainCursor);
DECLARE_OPCODE(o_restoreMainCursor);
DECLARE_OPCODE(o_soundWaitStop);
+ DECLARE_OPCODE(o_exitMap);
// Used in multiple stacks
DECLARE_OPCODE(o_quit);
@@ -144,6 +148,7 @@ protected:
MystResource *_invokingResource;
uint16 _savedCardId;
+ uint16 _savedMapCardId;
uint16 _savedCursorId;
int16 _tempVar; // Generic temp var used by the scripts
uint32 _startTime; // Generic start time used by the scripts
diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h
index 43820aa..a3ea406 100644
--- a/engines/mohawk/myst_stacks/channelwood.h
+++ b/engines/mohawk/myst_stacks/channelwood.h
@@ -49,6 +49,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9932; }
+
DECLARE_OPCODE(o_bridgeToggle);
DECLARE_OPCODE(o_pipeExtend);
DECLARE_OPCODE(o_drawImageChangeCardAndVolume);
diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h
index 112d28e..3bd7f2d 100644
--- a/engines/mohawk/myst_stacks/mechanical.h
+++ b/engines/mohawk/myst_stacks/mechanical.h
@@ -49,6 +49,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9931; }
+
void birdSing_run();
void elevatorRotation_run();
void elevatorGoMiddle_run();
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index ca546e2..9510d37 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -49,6 +49,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9934; }
+
void towerRotationMap_run();
void libraryBookcaseTransform_run();
void generatorControlRoom_run();
diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h
index fd4e937..d314c4d 100644
--- a/engines/mohawk/myst_stacks/selenitic.h
+++ b/engines/mohawk/myst_stacks/selenitic.h
@@ -50,6 +50,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9930; }
+
DECLARE_OPCODE(o_mazeRunnerMove);
DECLARE_OPCODE(o_mazeRunnerSoundRepeat);
DECLARE_OPCODE(o_soundReceiverSigma);
diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h
index 6def83f..4125412 100644
--- a/engines/mohawk/myst_stacks/stoneship.h
+++ b/engines/mohawk/myst_stacks/stoneship.h
@@ -49,6 +49,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9933; }
+
DECLARE_OPCODE(o_pumpTurnOff);
DECLARE_OPCODE(o_brotherDoorOpen);
DECLARE_OPCODE(o_cabinBookMovie);
Commit: af9dc7a29cd982f73fb425776e6c5c0071df6912
https://github.com/scummvm/scummvm/commit/af9dc7a29cd982f73fb425776e6c5c0071df6912
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2011-05-15T08:41:54-07:00
Commit Message:
MOHAWK: Display a black screen while changing stack. Default to an empty cursor.
Changed paths:
engines/mohawk/cursors.cpp
engines/mohawk/myst.cpp
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index c01aef9..f95084d 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -127,6 +127,13 @@ void MystCursorManager::hideCursor() {
}
void MystCursorManager::setCursor(uint16 id) {
+ // Zero means empty cursor
+ if (id == 0) {
+ static const byte emptyCursor = 0;
+ CursorMan.replaceCursor(&emptyCursor, 1, 1, 0, 0, 0);
+ return;
+ }
+
// Both Myst and Myst ME use the "MystBitmap" format for cursor images.
MohawkSurface *mhkSurface = _bmpDecoder->decodeImage(_vm->getResource(ID_WDIB, id));
Graphics::Surface *surface = mhkSurface->getSurface();
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 57d52d8..5a39b93 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -71,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;
@@ -415,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)
@@ -641,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();
Commit: 9f05f8805dfda0892b809e268c2c4869ca33d4ff
https://github.com/scummvm/scummvm/commit/9f05f8805dfda0892b809e268c2c4869ca33d4ff
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2011-05-15T08:41:55-07:00
Commit Message:
MOHAWK: Fix loading a Myst savegame from the launcher.
Changed paths:
engines/mohawk/myst.cpp
engines/mohawk/myst_state.cpp
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 5a39b93..432d111 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -258,6 +258,9 @@ Common::Error MohawkEngine_Myst::run() {
_cursor = new MystCursorManager(this);
_rnd = new Common::RandomSource();
+ // Cursor is visible by default
+ _cursor->showCursor();
+
// Load game from launcher/command line if requested
if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) {
uint32 gameToLoad = ConfMan.getInt("save_slot");
@@ -286,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
diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp
index fbb8bf0..bab4b8d 100644
--- a/engines/mohawk/myst_state.cpp
+++ b/engines/mohawk/myst_state.cpp
@@ -100,6 +100,9 @@ bool MystGameState::load(const Common::String &filename) {
syncGameState(s, size == 664);
delete loadFile;
+ // Switch us back to the intro stack, to the linking book
+ _vm->changeToStack(kIntroStack, 5, 0, 0);
+
// Set our default cursor
if (_globals.heldPage == 0 || _globals.heldPage > 13)
_vm->setMainCursor(kDefaultMystCursor);
@@ -110,9 +113,6 @@ bool MystGameState::load(const Common::String &filename) {
else // if (globals.heldPage == 13)
_vm->setMainCursor(kWhitePageCursor);
- // Switch us back to the intro stack, to the linking book
- _vm->changeToStack(kIntroStack, 5, 0, 0);
-
return true;
}
More information about the Scummvm-git-logs
mailing list