[Scummvm-cvs-logs] CVS: scummvm/wince pocketpc.cpp,1.29,1.30

Max Horn fingolfin at users.sourceforge.net
Sun Aug 18 10:49:02 CEST 2002


Update of /cvsroot/scummvm/scummvm/wince
In directory usw-pr-cvs1:/tmp/cvs-serv19809/wince

Modified Files:
	pocketpc.cpp 
Log Message:
MAJOR change to the way how Engine objects are instantiated

Index: pocketpc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/wince/pocketpc.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- pocketpc.cpp	18 Aug 2002 16:20:51 -0000	1.29
+++ pocketpc.cpp	18 Aug 2002 17:48:18 -0000	1.30
@@ -57,11 +57,7 @@
 typedef void SoundProc(void *param, byte *buf, int len);
 
 GameDetector detector;
-Gui gui;
-Scumm *g_scumm;
 SimonState *g_simon;
-OSystem *g_system;
-SoundMixer *g_mixer;
 Config *scummcfg;
 tTimeCallback timer_callback;
 int timer_interval;
@@ -443,46 +439,28 @@
 		return (-1);
 
 	OSystem *system = detector.createSystem();
+	Engine *engine;
 	
 	/* Simon the Sorcerer? */
 	if (detector._gameId >= GID_SIMON_FIRST && detector._gameId <= GID_SIMON_LAST) {
 		/* Simon the Sorcerer. Completely different initialization */
-		MidiDriver *midi = detector.createMidi();
-
-		keypad_init();
-		load_key_mapping();
-		hide_cursor = TRUE;
-		
-		g_simon = SimonState::create(system, midi);
-		g_system = g_simon->_system;
-		g_mixer = &g_simon->_mixer[0];
-		g_simon->_game = detector._gameId - GID_SIMON_FIRST;
-		g_simon->set_volume(detector._sfx_volume);
-		g_simon->_game_path = detector._gameDataPath;
-		g_simon->go();
+		detector._gameId -= GID_SIMON_FIRST;
+		engine = SimonState::createFromDetector(&detector, system);
 
 	} else {
-		Scumm *scumm = Scumm::createFromDetector(&detector, system);
-		g_scumm = scumm;
-		g_system = scumm->_system;
-		g_mixer = &scumm->_mixer[0];
+		engine = Scumm::createFromDetector(&detector, system);
 
-		scumm->_sound_volume_master = 0;
-		scumm->_sound_volume_music = detector._music_volume;
-		scumm->_sound_volume_sfx = detector._sfx_volume;
+	}
 
-		keypad_init();
-		load_key_mapping();
-		
-		hide_cursor = TRUE;
-		if (scumm->_gameId == GID_SAMNMAX || scumm->_gameId == GID_FT || scumm->_gameId == GID_DIG)
-			hide_cursor = FALSE;
+	keypad_init();
+	load_key_mapping();
+	
+	hide_cursor = TRUE;
+	if (detector._gameId == GID_SAMNMAX || detector._gameId == GID_FT || detector._gameId == GID_DIG)
+		hide_cursor = FALSE;
 
-		/* bind to Gui */
-		scumm->_gui = &gui;
-		gui.init(scumm);	/* Reinit GUI after loading a game */
-		scumm->go();
-	}
+
+	engine->go();
 	
 	return 0;
 }





More information about the Scummvm-git-logs mailing list