[Scummvm-cvs-logs] scummvm master -> 497324467f86656b747022661852255d1f3343fb

eriktorbjorn eriktorbjorn at telia.com
Fri Oct 17 19:21:25 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
497324467f TINSEL: Move object creation from constructor to run()


Commit: 497324467f86656b747022661852255d1f3343fb
    https://github.com/scummvm/scummvm/commit/497324467f86656b747022661852255d1f3343fb
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-10-17T19:19:55+02:00

Commit Message:
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.

Changed paths:
    engines/tinsel/tinsel.cpp



diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 31610a8..57d8432 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






More information about the Scummvm-git-logs mailing list