[Scummvm-cvs-logs] SF.net SVN: scummvm:[55230] scummvm/trunk/engines/mohawk

bgk at users.sourceforge.net bgk at users.sourceforge.net
Thu Jan 13 20:30:02 CET 2011


Revision: 55230
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55230&view=rev
Author:   bgk
Date:     2011-01-13 19:30:00 +0000 (Thu, 13 Jan 2011)

Log Message:
-----------
MOHAWK: Implement video seeking Myst's rocket link book

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/myst.cpp
    scummvm/trunk/engines/mohawk/myst.h
    scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/myst.h

Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp	2011-01-13 17:26:00 UTC (rev 55229)
+++ scummvm/trunk/engines/mohawk/myst.cpp	2011-01-13 19:30:00 UTC (rev 55230)
@@ -257,7 +257,6 @@
 	_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 @@
 
 		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 @@
 				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);

Modified: scummvm/trunk/engines/mohawk/myst.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst.h	2011-01-13 17:26:00 UTC (rev 55229)
+++ scummvm/trunk/engines/mohawk/myst.h	2011-01-13 19:30:00 UTC (rev 55230)
@@ -232,7 +232,6 @@
 	uint16 _cursorHintCount;
 	MystCursorHint *_cursorHints;
 	void loadCursorHints();
-	bool _mouseClicked;
 	uint16 _currentCursor;
 	uint16 _mainCursor; // Also defines the current page being held (white, blue, red, or none)
 };

Modified: scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2011-01-13 17:26:00 UTC (rev 55229)
+++ scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2011-01-13 19:30:00 UTC (rev 55230)
@@ -2164,12 +2164,20 @@
 	_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_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;

Modified: scummvm/trunk/engines/mohawk/myst_stacks/myst.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/myst.h	2011-01-13 17:26:00 UTC (rev 55229)
+++ scummvm/trunk/engines/mohawk/myst_stacks/myst.h	2011-01-13 19:30:00 UTC (rev 55230)
@@ -186,6 +186,7 @@
 	MystResourceType10 *_rocketSlider5; // 264
 	uint16 _rocketSliderSound; // 294
 	uint16 _rocketLeverPosition; // 296
+	VideoHandle _rocketLinkBook;
 
 	bool _libraryCombinationBookPagesTurning;
 	int16 _libraryBookPage; // 86


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list