aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2014-10-17 19:17:17 +0200
committerTorbjörn Andersson2014-10-17 19:19:55 +0200
commit497324467f86656b747022661852255d1f3343fb (patch)
treed703b0e4fb1e3f6f1d2a86aa79b4c70d4613900d /engines
parentdee4fd193d690baae5afaf906d7604a9df9155ef (diff)
downloadscummvm-rg350-497324467f86656b747022661852255d1f3343fb.tar.gz
scummvm-rg350-497324467f86656b747022661852255d1f3343fb.tar.bz2
scummvm-rg350-497324467f86656b747022661852255d1f3343fb.zip
TINSEL: Move object creation from constructor to run()
Moved the creation of _midiMusic, _pcmMusic, _sound and _bmv from the constructor to run(). It was reported on the forum that the MT-32 emulator didn't work for Discworld, and I'm speculating that this is because it was being initialized before the "extra path" had been added to the search path. It's likely that not all of these objects are needed for every version of the game. Fixing that is left as an exercise for someone more familiar with the different game versions than me.
Diffstat (limited to 'engines')
-rw-r--r--engines/tinsel/tinsel.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 31610a8467..57d8432f0e 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -821,7 +821,8 @@ const char *const TinselEngine::_textFiles[][3] = {
TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) :
- Engine(syst), _gameDescription(gameDesc), _random("tinsel") {
+ Engine(syst), _gameDescription(gameDesc), _random("tinsel"),
+ _sound(0), _midiMusic(0), _pcmMusic(0), _bmv(0) {
_vm = this;
_config = new Config(this);
@@ -846,13 +847,6 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
if (cd_num >= 0)
_system->getAudioCDManager()->openCD(cd_num);
- _midiMusic = new MidiMusicPlayer();
- _pcmMusic = new PCMMusicPlayer();
-
- _sound = new SoundManager(this);
-
- _bmv = new BMVPlayer();
-
_mousePos.x = 0;
_mousePos.y = 0;
_keyHandler = NULL;
@@ -896,6 +890,11 @@ void TinselEngine::initializePath(const Common::FSNode &gamePath) {
}
Common::Error TinselEngine::run() {
+ _midiMusic = new MidiMusicPlayer();
+ _pcmMusic = new PCMMusicPlayer();
+ _sound = new SoundManager(this);
+ _bmv = new BMVPlayer();
+
// Initialize backend
if (getGameID() == GID_DW2) {
#ifndef DW2_EXACT_SIZE