aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorMatthew Hoops2011-08-07 20:11:27 -0400
committerMatthew Hoops2011-08-07 20:11:27 -0400
commitc05c42ecc60c8f928628787272743f169a0d5903 (patch)
treef2b06be630676b7302a1fb62940099b2ec71442d /engines/mohawk
parente43a6671fc04f2c67b8efa2c0fdfdd6ec0ea1023 (diff)
parent45dc303159d5bbe77a351df31e6f2d2f97a3412d (diff)
downloadscummvm-rg350-c05c42ecc60c8f928628787272743f169a0d5903.tar.gz
scummvm-rg350-c05c42ecc60c8f928628787272743f169a0d5903.tar.bz2
scummvm-rg350-c05c42ecc60c8f928628787272743f169a0d5903.zip
Merge remote branch 'upstream/master' into soccer
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/console.cpp2
-rw-r--r--engines/mohawk/cstime.h2
-rw-r--r--engines/mohawk/dialogs.cpp4
-rw-r--r--engines/mohawk/livingbooks.h2
-rw-r--r--engines/mohawk/mohawk.cpp2
-rw-r--r--engines/mohawk/myst.cpp8
-rw-r--r--engines/mohawk/myst_stacks/preview.cpp2
-rw-r--r--engines/mohawk/myst_stacks/slides.cpp17
-rw-r--r--engines/mohawk/myst_stacks/slides.h2
-rw-r--r--engines/mohawk/myst_state.cpp8
-rw-r--r--engines/mohawk/sound.cpp5
-rw-r--r--engines/mohawk/sound.h7
12 files changed, 38 insertions, 23 deletions
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index e7dc84606c..0234c86c7e 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -117,7 +117,7 @@ static const char *mystStackNames[12] = {
static const uint16 default_start_card[12] = {
3137,
10000,
- 2001, // TODO: Should be 2000?
+ 2000,
5038,
2, // TODO: Should be 1?
1,
diff --git a/engines/mohawk/cstime.h b/engines/mohawk/cstime.h
index 3a1de6a137..0bc236f930 100644
--- a/engines/mohawk/cstime.h
+++ b/engines/mohawk/cstime.h
@@ -30,8 +30,6 @@
#include "common/random.h"
#include "common/list.h"
-#include "audio/mixer.h"
-
namespace Mohawk {
class CSTimeCase;
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index 6cb455917e..11e050aa72 100644
--- a/engines/mohawk/dialogs.cpp
+++ b/engines/mohawk/dialogs.cpp
@@ -113,6 +113,10 @@ void MystOptionsDialog::open() {
_showMapButton->setEnabled(_vm->_scriptParser &&
_vm->_scriptParser->getMap());
+ // Zip mode is disabled in the demo
+ if (_vm->getFeatures() & GF_DEMO)
+ _zipModeCheckbox->setEnabled(false);
+
_zipModeCheckbox->setState(_vm->_gameState->_globals.zipMode);
_transitionsCheckbox->setState(_vm->_gameState->_globals.transitions);
}
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 27e703a578..008a7dbf23 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -33,8 +33,6 @@
#include "common/queue.h"
#include "common/random.h"
-#include "audio/mixer.h"
-
#include "livingbooks_code.h"
namespace Common {
diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp
index faf52595b7..cb419064c0 100644
--- a/engines/mohawk/mohawk.cpp
+++ b/engines/mohawk/mohawk.cpp
@@ -31,8 +31,6 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
-#include "audio/mixer.h"
-
namespace Mohawk {
MohawkEngine::MohawkEngine(OSystem *syst, const MohawkGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) {
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 6bdf163a91..342fa4e78c 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -441,6 +441,7 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS
_scriptParser = new MystStacks::Credits(this);
break;
case kDemoStack:
+ _gameState->_globals.currentAge = 0;
_scriptParser = new MystStacks::Demo(this);
break;
case kDniStack:
@@ -469,6 +470,7 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS
_scriptParser = new MystStacks::Selenitic(this);
break;
case kDemoSlidesStack:
+ _gameState->_globals.currentAge = 1;
_scriptParser = new MystStacks::Slides(this);
break;
case kStoneshipStack:
@@ -645,7 +647,11 @@ void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) {
for (uint16 i = 0; i < _resources.size(); i++)
_resources[i]->handleCardChange();
- // TODO: Handle Script Resources
+ // The demo resets the cursor at each card change except when in the library
+ if (getFeatures() & GF_DEMO
+ && _gameState->_globals.currentAge != 2) {
+ _cursor->setDefaultCursor();
+ }
// Make sure the screen is updated
if (updateScreen) {
diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp
index 37b749f100..07e4fa6e57 100644
--- a/engines/mohawk/myst_stacks/preview.cpp
+++ b/engines/mohawk/myst_stacks/preview.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "mohawk/cursors.h"
#include "mohawk/myst.h"
#include "mohawk/graphics.h"
#include "mohawk/myst_areas.h"
@@ -35,6 +36,7 @@ namespace MystStacks {
Preview::Preview(MohawkEngine_Myst *vm) : Myst(vm) {
setupOpcodes();
+ _vm->_cursor->hideCursor();
}
Preview::~Preview() {
diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp
index 72b299ee6d..e9bb91c84d 100644
--- a/engines/mohawk/myst_stacks/slides.cpp
+++ b/engines/mohawk/myst_stacks/slides.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "mohawk/cursors.h"
#include "mohawk/myst.h"
#include "mohawk/graphics.h"
#include "mohawk/myst_areas.h"
@@ -35,6 +36,7 @@ namespace MystStacks {
Slides::Slides(MohawkEngine_Myst *vm) : MystScriptParser(vm) {
setupOpcodes();
+ _vm->_cursor->hideCursor();
}
Slides::~Slides() {
@@ -59,23 +61,20 @@ void Slides::disablePersistentScripts() {
void Slides::runPersistentScripts() {
if (_cardSwapEnabled) {
// Used on Cards...
- if (_vm->_system->getMillis() - _lastCardTime >= 2 * 1000)
+ if (_vm->_system->getMillis() > _nextCardTime)
_vm->changeToCard(_nextCardID, true);
}
}
void Slides::o_returnToMenu(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- _vm->changeToStack(kDemoStack, 2001, 0, 0);
+ // Go to the information screens of the menu
+ _vm->changeToStack(kDemoStack, 2002, 0, 0);
}
void Slides::o_setCardSwap(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- // Used on Cards...
- if (argc == 1) {
- _nextCardID = argv[0];
- _lastCardTime = _vm->_system->getMillis();
- _cardSwapEnabled = true;
- } else
- unknown(op, var, argc, argv);
+ _nextCardID = argv[0];
+ _nextCardTime = _vm->_system->getMillis() + 5000;
+ _cardSwapEnabled = true;
}
} // End of namespace MystStacks
diff --git a/engines/mohawk/myst_stacks/slides.h b/engines/mohawk/myst_stacks/slides.h
index 8bc61d0e24..9fb76728b6 100644
--- a/engines/mohawk/myst_stacks/slides.h
+++ b/engines/mohawk/myst_stacks/slides.h
@@ -52,7 +52,7 @@ private:
bool _cardSwapEnabled;
uint16 _nextCardID;
- uint32 _lastCardTime;
+ uint32 _nextCardTime;
};
} // End of namespace MystStacks
diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp
index bab4b8dd51..3a8d233a26 100644
--- a/engines/mohawk/myst_state.cpp
+++ b/engines/mohawk/myst_state.cpp
@@ -320,6 +320,10 @@ void MystGameState::deleteSave(const Common::String &saveName) {
void MystGameState::addZipDest(uint16 stack, uint16 view) {
ZipDests *zipDests = 0;
+ // The demo has no zip dest storage
+ if (_vm->getFeatures() & GF_DEMO)
+ return;
+
// Select stack
switch (stack) {
case kChannelwoodStack:
@@ -362,6 +366,10 @@ bool MystGameState::isReachableZipDest(uint16 stack, uint16 view) {
if (!_globals.zipMode)
return false;
+ // The demo has no zip dest storage
+ if (_vm->getFeatures() & GF_DEMO)
+ return false;
+
// Select stack
ZipDests *zipDests;
switch (stack) {
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 791b18db49..68b60515be 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -20,19 +20,20 @@
*
*/
-#include "mohawk/sound.h"
-
#include "common/debug.h"
#include "common/system.h"
#include "common/util.h"
#include "common/textconsole.h"
+#include "audio/midiparser.h"
#include "audio/musicplugin.h"
#include "audio/audiostream.h"
#include "audio/decoders/mp3.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/wave.h"
+#include "mohawk/sound.h"
+
namespace Mohawk {
Sound::Sound(MohawkEngine* vm) : _vm(vm) {
diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h
index 593f2fcd0b..12a59cdedf 100644
--- a/engines/mohawk/sound.h
+++ b/engines/mohawk/sound.h
@@ -27,14 +27,15 @@
#include "common/str.h"
#include "audio/audiostream.h"
-#include "audio/decoders/adpcm.h"
-#include "audio/mididrv.h"
-#include "audio/midiparser.h"
#include "audio/mixer.h"
+#include "audio/decoders/adpcm.h"
#include "mohawk/mohawk.h"
#include "mohawk/resource.h"
+class MidiDriver;
+class MidiParser;
+
namespace Mohawk {
#define MAX_CHANNELS 2 // Can there be more than 2?