diff options
author | Filippos Karapetis | 2015-12-13 18:41:53 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:02 +0100 |
commit | dffaffdd096d9ee7457a8b3b8f1db78af1b0cff5 (patch) | |
tree | 321f0ed39066c83d3343da49bde72f17a14dbb3a /engines/lab | |
parent | 40b16afcab183189c32ee697e6e027e734d72542 (diff) | |
download | scummvm-rg350-dffaffdd096d9ee7457a8b3b8f1db78af1b0cff5.tar.gz scummvm-rg350-dffaffdd096d9ee7457a8b3b8f1db78af1b0cff5.tar.bz2 scummvm-rg350-dffaffdd096d9ee7457a8b3b8f1db78af1b0cff5.zip |
LAB: Simplify calls to initMusic()
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/intro.cpp | 2 | ||||
-rw-r--r-- | engines/lab/music.cpp | 11 | ||||
-rw-r--r-- | engines/lab/music.h | 4 | ||||
-rw-r--r-- | engines/lab/processroom.cpp | 3 |
4 files changed, 4 insertions, 16 deletions
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp index 2e88132da8..7c77e8a18b 100644 --- a/engines/lab/intro.cpp +++ b/engines/lab/intro.cpp @@ -262,7 +262,7 @@ void Intro::introSequence() { } _vm->_graphics->blackAllScreen(); - _vm->_music->initMusic(); + _vm->_music->initMusic("Music:BackGrou"); _vm->_anim->_noPalChange = true; if (_vm->getPlatform() != Common::kPlatformWindows) diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp index 1d2527b50e..b9a3f10873 100644 --- a/engines/lab/music.cpp +++ b/engines/lab/music.cpp @@ -56,7 +56,6 @@ Music::Music(LabEngine *vm) : _vm(vm) { _leftInFile = 0; _musicOn = false; - _winMusic = false; _loopSoundEffect = false; _queuingAudioStream = NULL; _lastMusicRoom = 1; @@ -166,17 +165,9 @@ void Music::startMusic(bool restartFl) { /** * Initializes the music buffers. */ -bool Music::initMusic() { +bool Music::initMusic(const char *filename) { _musicOn = true; _musicPaused = false; - - const char *filename; - - if (_winMusic) - filename = "Music:WinGame"; - else - filename = "Music:BackGrou"; - _file = _vm->_resource->openDataFile(filename); startMusic(true); return true; diff --git a/engines/lab/music.h b/engines/lab/music.h index 35fd583ef4..d5dd241d6e 100644 --- a/engines/lab/music.h +++ b/engines/lab/music.h @@ -56,7 +56,6 @@ private: bool _musicOn; bool _musicPaused; bool _oldMusicOn; - bool _winMusic; uint16 _lastMusicRoom ; @@ -84,7 +83,7 @@ public: void changeMusic(const char *newmusic); void checkRoomMusic(); void freeMusic(); - bool initMusic(); + bool initMusic(const char *filename); bool isSoundEffectActive() const; void playSoundEffect(uint16 sampleSpeed, uint32 length, void *data); bool readMusic(const char *filename, bool waitTillFinished); @@ -92,7 +91,6 @@ public: void resumeBackMusic(); void setMusic(bool on); void setMusicReset(bool reset) { _doReset = reset; } - void setWinMusic() { _winMusic = true; } void stopSoundEffect(); void updateMusic(); }; diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 6000f4abf8..bdf1d96b45 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -475,9 +475,8 @@ void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) { break; case WINMUSIC: - _music->setWinMusic(); _music->freeMusic(); - _music->initMusic(); + _music->initMusic("Music:WinGame"); break; case WINGAME: |