[Scummvm-cvs-logs] SF.net SVN: scummvm:[36125] scummvm/trunk/engines/groovie
spookypeanut at users.sourceforge.net
spookypeanut at users.sourceforge.net
Thu Jan 29 00:29:19 CET 2009
Revision: 36125
http://scummvm.svn.sourceforge.net/scummvm/?rev=36125&view=rev
Author: spookypeanut
Date: 2009-01-28 23:29:19 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
T7G: start background music at start of input loop (0x0B). Should fix 2474078, but might break other things so I'm not going to backport it.
Modified Paths:
--------------
scummvm/trunk/engines/groovie/music.cpp
scummvm/trunk/engines/groovie/music.h
scummvm/trunk/engines/groovie/script.cpp
Modified: scummvm/trunk/engines/groovie/music.cpp
===================================================================
--- scummvm/trunk/engines/groovie/music.cpp 2009-01-28 21:49:38 UTC (rev 36124)
+++ scummvm/trunk/engines/groovie/music.cpp 2009-01-28 23:29:19 UTC (rev 36125)
@@ -33,7 +33,7 @@
MusicPlayer::MusicPlayer(GroovieEngine *vm, const Common::String >lName) :
_vm(vm), _midiParser(NULL), _data(NULL), _driver(NULL),
- _backgroundFileRef(0), _gameVolume(100), _prevCDtrack(0) {
+ _backgroundFileRef(0), _gameVolume(100), _prevCDtrack(0), _isPlaying(0) {
// Create the parser
_midiParser = MidiParser::createParser_XMIDI();
@@ -174,12 +174,17 @@
_fadingEndVolume = 100;
}
+void MusicPlayer::startBackground() {
+ if (!_isPlaying && _backgroundFileRef) {
+ play(_backgroundFileRef, true);
+ }
+}
+
void MusicPlayer::endTrack() {
debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: End of song");
unload();
- if (_backgroundFileRef) {
- play(_backgroundFileRef, true);
- }
+ _isPlaying = false;
+ startBackground();
}
void MusicPlayer::applyFading() {
@@ -232,6 +237,7 @@
_midiParser->property(MidiParser::mpAutoLoop, loop);
_gameVolume = 100;
+ _isPlaying = true;
// Load the new file
return load(fileref);
}
Modified: scummvm/trunk/engines/groovie/music.h
===================================================================
--- scummvm/trunk/engines/groovie/music.h 2009-01-28 21:49:38 UTC (rev 36124)
+++ scummvm/trunk/engines/groovie/music.h 2009-01-28 23:29:19 UTC (rev 36125)
@@ -41,6 +41,7 @@
void playSong(uint16 fileref);
void setBackgroundSong(uint16 fileref);
void playCD(uint8 track);
+ void startBackground();
// Volume
void setUserVolume(uint16 volume);
@@ -99,6 +100,7 @@
MidiParser *_midiParser;
MidiDriver *_driver;
uint8 _musicType;
+ bool _isPlaying;
uint16 _backgroundFileRef;
uint8 _prevCDtrack;
Modified: scummvm/trunk/engines/groovie/script.cpp
===================================================================
--- scummvm/trunk/engines/groovie/script.cpp 2009-01-28 21:49:38 UTC (rev 36124)
+++ scummvm/trunk/engines/groovie/script.cpp 2009-01-28 23:29:19 UTC (rev 36125)
@@ -582,6 +582,8 @@
_mouseClicked = _eventMouseClicked;
_eventMouseClicked = false;
+ _vm->_musicPlayer->startBackground();
+
// Save the current pressed character for the whole loop
_kbdChar = _eventKbdChar;
_eventKbdChar = 0;
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