aboutsummaryrefslogtreecommitdiff
path: root/engines/groovie/music.cpp
diff options
context:
space:
mode:
authorScott Thomas2009-08-05 13:57:40 +0000
committerScott Thomas2009-08-05 13:57:40 +0000
commit8820b6166ecc5f2c76e926aefdbf4d3ad6f2f062 (patch)
tree17ee69adb605a0618eb28b97c379273cd0d98690 /engines/groovie/music.cpp
parent26b372603bf84ad050d0c7b0db6896eb5279664e (diff)
downloadscummvm-rg350-8820b6166ecc5f2c76e926aefdbf4d3ad6f2f062.tar.gz
scummvm-rg350-8820b6166ecc5f2c76e926aefdbf4d3ad6f2f062.tar.bz2
scummvm-rg350-8820b6166ecc5f2c76e926aefdbf4d3ad6f2f062.zip
T7G: Fix bug #2831041 by implementing opcode responsible for starting music partway through a video
svn-id: r43068
Diffstat (limited to 'engines/groovie/music.cpp')
-rw-r--r--engines/groovie/music.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 1a1de92156..797290a6f3 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -35,7 +35,7 @@ namespace Groovie {
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 @@ void MusicPlayer::setBackgroundSong(uint32 fileref) {
_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;