aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorBastien Bouclet2011-01-13 19:30:00 +0000
committerBastien Bouclet2011-01-13 19:30:00 +0000
commit75a2c36ecd9ff0f9dc268166b908450c7c6b90b2 (patch)
tree2c1156df35c8481df904fec5b958a8844e4b64b9 /engines/mohawk
parent9118d2915cf12f5bfac36895e4628358882fcfa0 (diff)
downloadscummvm-rg350-75a2c36ecd9ff0f9dc268166b908450c7c6b90b2.tar.gz
scummvm-rg350-75a2c36ecd9ff0f9dc268166b908450c7c6b90b2.tar.bz2
scummvm-rg350-75a2c36ecd9ff0f9dc268166b908450c7c6b90b2.zip
MOHAWK: Implement video seeking Myst's rocket link book
svn-id: r55230
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/myst.cpp12
-rw-r--r--engines/mohawk/myst.h1
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp20
-rw-r--r--engines/mohawk/myst_stacks/myst.h1
4 files changed, 21 insertions, 13 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 1dbeca5a35..bbaf0fead6 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -257,7 +257,6 @@ Common::Error MohawkEngine_Myst::run() {
_optionsDialog = new MystOptionsDialog(this);
_cursor = new MystCursorManager(this);
_rnd = new Common::RandomSource();
- _mouseClicked = false;
// Load game from launcher/command line if requested
if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) {
@@ -298,20 +297,22 @@ Common::Error MohawkEngine_Myst::run() {
while (_eventMan->pollEvent(event)) {
switch (event.type) {
- case Common::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE: {
_needsUpdate = true;
_mouse = event.mouse;
+ bool mouseClicked = _system->getEventManager()->getButtonState() & 1;
+
// Keep the same resource when dragging
- if (!_mouseClicked) {
+ if (!mouseClicked) {
checkCurrentResource();
}
- if (_curResource >= 0 && _resources[_curResource]->isEnabled() && _mouseClicked) {
+ if (_curResource >= 0 && _resources[_curResource]->isEnabled() && mouseClicked) {
debug(2, "Sending mouse move event to resource %d", _curResource);
_resources[_curResource]->handleMouseDrag(event.mouse);
}
break;
+ }
case Common::EVENT_LBUTTONUP:
- _mouseClicked = false;
_mouse = event.mouse;
if (_curResource >= 0 && _resources[_curResource]->isEnabled()) {
debug(2, "Sending mouse up event to resource %d", _curResource);
@@ -320,7 +321,6 @@ Common::Error MohawkEngine_Myst::run() {
checkCurrentResource();
break;
case Common::EVENT_LBUTTONDOWN:
- _mouseClicked = true;
_mouse = event.mouse;
if (_curResource >= 0 && _resources[_curResource]->isEnabled()) {
debug(2, "Sending mouse up event to resource %d", _curResource);
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index 893c1b3a5d..7e9a1bd37d 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -232,7 +232,6 @@ private:
uint16 _cursorHintCount;
MystCursorHint *_cursorHints;
void loadCursorHints();
- bool _mouseClicked;
uint16 _currentCursor;
uint16 _mainCursor; // Also defines the current page being held (white, blue, red, or none)
};
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 7a163064c3..5760bee22d 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -2164,11 +2164,19 @@ void MystScriptParser_Myst::rocketCheckSolution() {
_vm->_sound->stopSound();
if (solved) {
- _vm->_video->playBackgroundMovie(_vm->wrapMovieFilename("selenbok", kMystStack), 224, 41, true);
+ // Reset lever position
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+ lever->drawFrame(0);
- // TODO: Movie control
- // Play from 0 to 660
- // Then from 660 to 3500, looping
+ // Book appearing
+ Common::String movieFile = _vm->wrapMovieFilename("selenbok", kMystStack);
+ _rocketLinkBook = _vm->_video->playBackgroundMovie(movieFile, 224, 41);
+ _vm->_video->setVideoBounds(_rocketLinkBook, Graphics::VideoTimestamp(0, 600), Graphics::VideoTimestamp(660, 600));
+ _vm->_video->waitUntilMovieEnds(_rocketLinkBook);
+
+ // Book looping closed
+ _rocketLinkBook = _vm->_video->playBackgroundMovie(movieFile, 224, 41, true);
+ _vm->_video->setVideoBounds(_rocketLinkBook, Graphics::VideoTimestamp(660, 600), Graphics::VideoTimestamp(3500, 600));
_tempVar = 1;
}
@@ -2282,8 +2290,8 @@ void MystScriptParser_Myst::o_rocketLeverStartMove(uint16 op, uint16 var, uint16
void MystScriptParser_Myst::o_rocketOpenBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
debugC(kDebugScript, "Opcode %d: Rocket open link book", op);
- // TODO: Update video playing
- // Play from 3500 to 13100, looping
+ // Flyby movie
+ _vm->_video->setVideoBounds(_rocketLinkBook, Graphics::VideoTimestamp(3500, 600), Graphics::VideoTimestamp(13100, 600));
// Set linkable
_tempVar = 2;
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index f48117a917..b115711d4f 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -186,6 +186,7 @@ private:
MystResourceType10 *_rocketSlider5; // 264
uint16 _rocketSliderSound; // 294
uint16 _rocketLeverPosition; // 296
+ VideoHandle _rocketLinkBook;
bool _libraryCombinationBookPagesTurning;
int16 _libraryBookPage; // 86