[Scummvm-cvs-logs] SF.net SVN: scummvm:[43068] scummvm/trunk/engines/groovie
scott_t at users.sourceforge.net
scott_t at users.sourceforge.net
Wed Aug 5 15:57:40 CEST 2009
Revision: 43068
http://scummvm.svn.sourceforge.net/scummvm/?rev=43068&view=rev
Author: scott_t
Date: 2009-08-05 13:57:40 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
T7G: Fix bug #2831041 by implementing opcode responsible for starting music partway through a video
Modified Paths:
--------------
scummvm/trunk/engines/groovie/music.cpp
scummvm/trunk/engines/groovie/music.h
scummvm/trunk/engines/groovie/script.cpp
scummvm/trunk/engines/groovie/script.h
Modified: scummvm/trunk/engines/groovie/music.cpp
===================================================================
--- scummvm/trunk/engines/groovie/music.cpp 2009-08-05 10:47:32 UTC (rev 43067)
+++ scummvm/trunk/engines/groovie/music.cpp 2009-08-05 13:57:40 UTC (rev 43068)
@@ -35,7 +35,7 @@
MusicPlayer::MusicPlayer(GroovieEngine *vm) :
_vm(vm), _isPlaying(false), _backgroundFileRef(0), _gameVolume(100),
- _prevCDtrack(0) {
+ _prevCDtrack(0), _backgroundDelay(0) {
}
void MusicPlayer::playSong(uint32 fileref) {
@@ -56,6 +56,18 @@
_backgroundFileRef = fileref;
}
+void MusicPlayer::frameTick() {
+ if (_backgroundDelay > 0) {
+ _backgroundDelay--;
+ if (_backgroundDelay == 0)
+ playSong(_backgroundFileRef);
+ }
+}
+
+void MusicPlayer::setBackgroundDelay(uint16 delay) {
+ _backgroundDelay = delay;
+}
+
void MusicPlayer::playCD(uint8 track) {
int startms = 0;
Modified: scummvm/trunk/engines/groovie/music.h
===================================================================
--- scummvm/trunk/engines/groovie/music.h 2009-08-05 10:47:32 UTC (rev 43067)
+++ scummvm/trunk/engines/groovie/music.h 2009-08-05 13:57:40 UTC (rev 43068)
@@ -44,6 +44,9 @@
void playCD(uint8 track);
void startBackground();
+ void frameTick();
+ void setBackgroundDelay(uint16 delay);
+
// Volume
void setUserVolume(uint16 volume);
void setGameVolume(uint16 volume, uint16 time);
@@ -55,6 +58,8 @@
uint32 _backgroundFileRef;
uint8 _prevCDtrack;
+ uint16 _backgroundDelay;
+
// Volume fading
uint32 _fadingStartTime;
uint16 _fadingStartVolume;
Modified: scummvm/trunk/engines/groovie/script.cpp
===================================================================
--- scummvm/trunk/engines/groovie/script.cpp 2009-08-05 10:47:32 UTC (rev 43067)
+++ scummvm/trunk/engines/groovie/script.cpp 2009-08-05 13:57:40 UTC (rev 43068)
@@ -564,6 +564,7 @@
// Video available, play one frame
if (_videoFile) {
bool endVideo = _vm->_videoPlayer->playFrame();
+ _vm->_musicPlayer->frameTick();
if (endVideo) {
// Close the file
@@ -1491,6 +1492,14 @@
_vm->_musicPlayer->playCD(val);
}
+void Script::o_musicdelay() {
+ uint16 delay = readScript16bits();
+
+ debugScript(1, true, "MUSICDELAY %d", delay);
+
+ _vm->_musicPlayer->setBackgroundDelay(delay);
+}
+
void Script::o_hotspot_outrect() {
uint16 left = readScript16bits();
uint16 top = readScript16bits();
@@ -1662,8 +1671,8 @@
&Script::o_nop8,
&Script::o_getcd, // 0x4C
&Script::o_playcd,
+ &Script::o_musicdelay,
&Script::o_nop16,
- &Script::o_nop16,
&Script::o_nop16, // 0x50
&Script::o_nop16,
//&Script::o_nop8,
Modified: scummvm/trunk/engines/groovie/script.h
===================================================================
--- scummvm/trunk/engines/groovie/script.h 2009-08-05 10:47:32 UTC (rev 43067)
+++ scummvm/trunk/engines/groovie/script.h 2009-08-05 13:57:40 UTC (rev 43068)
@@ -219,6 +219,7 @@
void o_sethotspotleft();
void o_getcd();
void o_playcd();
+ void o_musicdelay();
void o_hotspot_outrect();
void o_stub56();
void o_stub59();
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