[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.cpp,1.271,1.272 scumm.h,1.514,1.515

Eugene Sandulenko sev at users.sourceforge.net
Sun Nov 14 19:58:03 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21119

Modified Files:
	scumm.cpp scumm.h 
Log Message:
Move most heavy initialization from engine constructor to mainInit()
method which is called from go(). This ensures that extrapath is added
to list od default directories after all other paths.


Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -d -r1.271 -r1.272
--- scumm.cpp	9 Nov 2004 10:26:33 -0000	1.271
+++ scumm.cpp	15 Nov 2004 03:57:21 -0000	1.272
@@ -896,54 +896,7 @@
 		_screenHeight = 200;
 	}
 
-	// Initialize backend
-	_system->initSize(_screenWidth, _screenHeight);
-	int cd_num = ConfMan.getInt("cdrom");
-	if (cd_num >= 0 && (_features & GF_AUDIOTRACKS))
-		_system->openCD(cd_num);
-
-	// Create the sound manager
-	_sound = new Sound(this);
-	
-	// Setup the music engine
-	setupMusic(gs.midi);
-
-	// TODO: We shouldn't rely on the global Language values matching those COMI etc. expect.
-	// Rather we should explicitly translate them.
-	_language = Common::parseLanguage(ConfMan.get("language"));
-
-	// Load localization data, if present
-	loadLanguageBundle();
-
-	// Load CJK font, if present
-	loadCJKFont();
-
-	// Create the charset renderer
-	if (_version <= 2)
-		_charset = new CharsetRendererV2(this, _language);
-	else if (_version == 3)
-		_charset = new CharsetRendererV3(this);
-	else if (_version == 8)
-		_charset = new CharsetRendererNut(this);
-	else
-		_charset = new CharsetRendererClassic(this);
-
-	// Create the costume renderer
-	if (_features & GF_NEW_COSTUMES)
-		_costumeRenderer = new AkosRenderer(this);
-	else
-		_costumeRenderer = new CostumeRenderer(this);
-
-	// Create FT INSANE object
-	if (_gameId == GID_FT)
-		_insane = new Insane((ScummEngine_v6 *)this);
-	else
-		_insane = 0;
-
-	// Load game from specified slot, if any
-	if (ConfMan.hasKey("save_slot")) {
-		requestLoad(ConfMan.getInt("save_slot"));
-	}
+	_midi = gs.midi;
 }
 
 ScummEngine::~ScummEngine() {
@@ -1030,6 +983,56 @@
 
 void ScummEngine::mainInit() {
 
+	// Initialize backend
+	_system->initSize(_screenWidth, _screenHeight);
+
+	int cd_num = ConfMan.getInt("cdrom");
+	if (cd_num >= 0 && (_features & GF_AUDIOTRACKS))
+		_system->openCD(cd_num);
+
+	// Create the sound manager
+	_sound = new Sound(this);
+	
+	// Setup the music engine
+	setupMusic(_midi);
+
+	// TODO: We shouldn't rely on the global Language values matching those COMI etc. expect.
+	// Rather we should explicitly translate them.
+	_language = Common::parseLanguage(ConfMan.get("language"));
+
+	// Load localization data, if present
+	loadLanguageBundle();
+
+	// Load CJK font, if present
+	loadCJKFont();
+
+	// Create the charset renderer
+	if (_version <= 2)
+		_charset = new CharsetRendererV2(this, _language);
+	else if (_version == 3)
+		_charset = new CharsetRendererV3(this);
+	else if (_version == 8)
+		_charset = new CharsetRendererNut(this);
+	else
+		_charset = new CharsetRendererClassic(this);
+
+	// Create the costume renderer
+	if (_features & GF_NEW_COSTUMES)
+		_costumeRenderer = new AkosRenderer(this);
+	else
+		_costumeRenderer = new CostumeRenderer(this);
+
+	// Create FT INSANE object
+	if (_gameId == GID_FT)
+		_insane = new Insane((ScummEngine_v6 *)this);
+	else
+		_insane = 0;
+
+	// Load game from specified slot, if any
+	if (ConfMan.hasKey("save_slot")) {
+		requestLoad(ConfMan.getInt("save_slot"));
+	}
+
 #ifdef __PALM_OS__
 	if (_features & GF_NEW_COSTUMES)
 		_maxHeapThreshold = gVars->memory[kMemScummNewCostGames];

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.514
retrieving revision 1.515
diff -u -d -r1.514 -r1.515
--- scumm.h	5 Nov 2004 05:13:56 -0000	1.514
+++ scumm.h	15 Nov 2004 03:57:22 -0000	1.515
@@ -1089,6 +1089,7 @@
 	int _tempMusic;
 	int _saveSound;
 	bool _native_mt32;
+	int _midi;
 	int _midiDriver; // Use the MD_ values from mididrv.h
 	bool _copyProtection;
 	bool _demoMode;





More information about the Scummvm-git-logs mailing list