[Scummvm-cvs-logs] SF.net SVN: scummvm:[43069] scummvm/branches/branch-1-0-0/engines/groovie

scott_t at users.sourceforge.net scott_t at users.sourceforge.net
Wed Aug 5 16:01:28 CEST 2009


Revision: 43069
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43069&view=rev
Author:   scott_t
Date:     2009-08-05 14:01:26 +0000 (Wed, 05 Aug 2009)

Log Message:
-----------
Backport of r43068: T7G: Fix bug #2831041 by implementing opcode responsible for starting music partway through a video

Modified Paths:
--------------
    scummvm/branches/branch-1-0-0/engines/groovie/music.cpp
    scummvm/branches/branch-1-0-0/engines/groovie/music.h
    scummvm/branches/branch-1-0-0/engines/groovie/script.cpp
    scummvm/branches/branch-1-0-0/engines/groovie/script.h

Modified: scummvm/branches/branch-1-0-0/engines/groovie/music.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/groovie/music.cpp	2009-08-05 13:57:40 UTC (rev 43068)
+++ scummvm/branches/branch-1-0-0/engines/groovie/music.cpp	2009-08-05 14:01:26 UTC (rev 43069)
@@ -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/branches/branch-1-0-0/engines/groovie/music.h
===================================================================
--- scummvm/branches/branch-1-0-0/engines/groovie/music.h	2009-08-05 13:57:40 UTC (rev 43068)
+++ scummvm/branches/branch-1-0-0/engines/groovie/music.h	2009-08-05 14:01:26 UTC (rev 43069)
@@ -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/branches/branch-1-0-0/engines/groovie/script.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/groovie/script.cpp	2009-08-05 13:57:40 UTC (rev 43068)
+++ scummvm/branches/branch-1-0-0/engines/groovie/script.cpp	2009-08-05 14:01:26 UTC (rev 43069)
@@ -563,6 +563,7 @@
 	// Video available, play one frame
 	if (_videoFile) {
 		bool endVideo = _vm->_videoPlayer->playFrame();
+		_vm->_musicPlayer->frameTick();
 
 		if (endVideo) {
 			// Close the file
@@ -1490,6 +1491,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();
@@ -1661,8 +1670,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/branches/branch-1-0-0/engines/groovie/script.h
===================================================================
--- scummvm/branches/branch-1-0-0/engines/groovie/script.h	2009-08-05 13:57:40 UTC (rev 43068)
+++ scummvm/branches/branch-1-0-0/engines/groovie/script.h	2009-08-05 14:01:26 UTC (rev 43069)
@@ -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