[Scummvm-cvs-logs] SF.net SVN: scummvm:[55244] scummvm/trunk/engines/mohawk/myst_stacks
bgk at users.sourceforge.net
bgk at users.sourceforge.net
Fri Jan 14 21:08:27 CET 2011
Revision: 55244
http://scummvm.svn.sourceforge.net/scummvm/?rev=55244&view=rev
Author: bgk
Date: 2011-01-14 20:08:27 +0000 (Fri, 14 Jan 2011)
Log Message:
-----------
MOHAWK: Implement video looping for Myst's green book
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
scummvm/trunk/engines/mohawk/myst_stacks/myst.h
Modified: scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp 2011-01-14 19:47:25 UTC (rev 55243)
+++ scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp 2011-01-14 20:08:27 UTC (rev 55244)
@@ -220,6 +220,7 @@
_observatoryDayChanging = false;
_observatoryYearChanging = false;
_observatoryTimeChanging = false;
+ _greenBookRunning = false;
}
void MystScriptParser_Myst::runPersistentScripts() {
@@ -276,6 +277,9 @@
if (_observatoryTimeChanging)
observatoryTimeChange_run();
+
+ if (_greenBookRunning)
+ greenBook_run();
}
uint16 MystScriptParser_Myst::getVar(uint16 var) {
@@ -3251,6 +3255,11 @@
// Used for Card 4168 (Green Book Movies)
debugC(kDebugScript, "Opcode %d: Green book init", op);
+ _greenBookRunning = true;
+ _tempVar = 1;
+}
+
+void MystScriptParser_Myst::greenBook_run() {
uint loopStart = 0;
uint loopEnd = 0;
Common::String file;
@@ -3265,15 +3274,24 @@
file = _vm->wrapMovieFilename("atrusbk2", kMystStack);
}
- _vm->_sound->stopSound();
- _vm->_sound->pauseBackground();
+ if (_tempVar == 1) {
+ _vm->_sound->stopSound();
+ _vm->_sound->pauseBackground();
- if (_globals.ending != 4) {
- _vm->_video->playBackgroundMovie(file, 314, 76);
+ if (_globals.ending != 4) {
+ _tempVar = 2;
+ _vm->_video->playBackgroundMovie(file, 314, 76);
+ } else {
+ VideoHandle book = _vm->_video->playBackgroundMovie(file, 314, 76, true);
+ _vm->_video->setVideoBounds(book, Graphics::VideoTimestamp(loopStart, 600), Graphics::VideoTimestamp(loopEnd, 600));
+ _tempVar = 0;
+ }
+ } else if (_tempVar == 2 && !_vm->_video->isVideoPlaying()) {
+ VideoHandle book = _vm->_video->playBackgroundMovie(file, 314, 76);
+ _vm->_video->setVideoBounds(book, Graphics::VideoTimestamp(loopStart, 600), Graphics::VideoTimestamp(loopEnd, 600));
+ _vm->_video->setVideoLooping(book, true);
+ _tempVar = 0;
}
-
- // TODO: Movie play control
- // loop between loopStart and loopEnd
}
void MystScriptParser_Myst::opcode_222(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
Modified: scummvm/trunk/engines/mohawk/myst_stacks/myst.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/myst.h 2011-01-14 19:47:25 UTC (rev 55243)
+++ scummvm/trunk/engines/mohawk/myst_stacks/myst.h 2011-01-14 20:08:27 UTC (rev 55244)
@@ -70,6 +70,7 @@
void observatoryDayChange_run();
void observatoryYearChange_run();
void observatoryTimeChange_run();
+ void greenBook_run();
DECLARE_OPCODE(o_libraryBookPageTurnLeft);
DECLARE_OPCODE(o_libraryBookPageTurnRight);
@@ -261,6 +262,8 @@
int16 _observatoryIncrement; // 346
MystResourceType10 *_observatoryCurrentSlider; // 348
+ bool _greenBookRunning;
+
void generatorRedrawRocket();
void generatorButtonValue(MystResource *button, uint16 &offset, uint16 &value);
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