[Scummvm-cvs-logs] CVS: scummvm/common engine.h,1.18,1.19 gameDetector.cpp,1.84,1.85 gameDetector.h,1.33,1.34 main.cpp,1.24,1.25 scaler.h,1.4,1.5 system.h,1.25,1.26

Max Horn fingolfin at users.sourceforge.net
Mon Mar 24 16:27:05 CET 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv24551/common

Modified Files:
	engine.h gameDetector.cpp gameDetector.h main.cpp scaler.h 
	system.h 
Log Message:
cleanup

Index: engine.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- engine.h	7 Mar 2003 15:37:57 -0000	1.18
+++ engine.h	25 Mar 2003 00:26:52 -0000	1.19
@@ -29,6 +29,7 @@
 
 class SoundMixer;
 class GameDetector;
+class Timer;
 struct VersionSettings;
 
 /* FIXME - BIG HACK for MidiEmu */

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- gameDetector.cpp	18 Mar 2003 06:53:14 -0000	1.84
+++ gameDetector.cpp	25 Mar 2003 00:26:52 -0000	1.85
@@ -22,9 +22,10 @@
 
 #include "stdafx.h"
 #include "sound/mididrv.h"
-#include "common/engine.h"
-#include "common/gameDetector.h"
-#include "common/config-file.h"
+#include "engine.h"
+#include "gameDetector.h"
+#include "config-file.h"
+#include "scaler.h"	// Only for gfx_modes
 
 #define CHECK_OPTION() if ((current_option != NULL) || (*s != '\0')) goto ShowHelpAndExit
 #define HANDLE_OPTION() if ((*s == '\0') && (current_option == NULL)) goto ShowHelpAndExit;  \
@@ -76,7 +77,7 @@
 // This contains a pointer to a list of all supported games.
 const VersionSettings *version_settings = NULL;
 
-static const struct GraphicsModes gfx_modes[] = {
+static const struct GraphicsMode gfx_modes[] = {
 	{"normal", "Normal (no scaling)", GFX_NORMAL},
 	{"1x", "Normal (no scaling)", GFX_NORMAL},
 	{"2x", "2x", GFX_DOUBLESIZE},
@@ -90,7 +91,7 @@
 	{0, 0}
 };
 
-static const struct Languages languages[] = {
+static const struct Language languages[] = {
 	{"en", "English", EN_USA},
 	{"de", "German", DE_DEU},
 	{"fr", "French", FR_FRA},
@@ -104,7 +105,7 @@
 	{0, 0, 0}
 };
 
-static const struct MusicDrivers music_drivers[] = {
+static const struct MusicDriver music_drivers[] = {
 	{"auto", "Default", MD_AUTO},
 	{"null", "No music", MD_NULL},
 	{"windows", "Windows MIDI", MD_WINDOWS},
@@ -160,26 +161,6 @@
 #endif
 	_default_gfx_mode = true;
 
-#if defined(USE_NULL_DRIVER)
-	_gfx_driver = GD_NULL;
-#elif defined(__DC__)
-	_gfx_driver = GD_DC;
-#elif defined(X11_BACKEND)
-	_gfx_driver = GD_X;
-#elif defined(__MORPHOS__)
-	_gfx_driver = GD_MORPHOS;
-#elif defined(_WIN32_WCE)
-	_gfx_driver = GD_WINCE;
-#elif defined(MACOS_CARBON)
-	_gfx_driver = GD_MAC;
-#elif defined(__GP32__)	// ph0x
-	_gfx_driver = GD_GP32;
-#else
-	/* SDL is the default driver for now */
-	_gfx_driver = GD_SDL;
-#endif
-
-
 	if (version_settings == NULL) {
 		// Gather & combine the target lists from the modules
 		const VersionSettings *scummVersions = Engine_SCUMM_targetList();
@@ -466,7 +447,7 @@
 }
 
 int GameDetector::parseGraphicsMode(const char *s) {
-	const GraphicsModes *gm = gfx_modes;
+	const GraphicsMode *gm = gfx_modes;
 	while(gm->name) {
 		if (!scumm_stricmp(gm->name, s)) {
 			_default_gfx_mode = false;
@@ -479,7 +460,7 @@
 }
 
 int GameDetector::parseLanguage(const char *s) {
-	const Languages *l = languages;
+	const Language *l = languages;
 	while(l->name) {
 		if (!scumm_stricmp(l->name, s))
 			return l->id;
@@ -516,12 +497,12 @@
 	return false;
 }
 
-const MusicDrivers *GameDetector::getMusicDrivers() {
+const MusicDriver *GameDetector::getMusicDrivers() {
 	return music_drivers;
 }
 
 bool GameDetector::parseMusicDriver(const char *s) {
-	const MusicDrivers *md = music_drivers;
+	const MusicDriver *md = music_drivers;
 
 	while (md->name) {
 		if (!scumm_stricmp(md->name, s)) {
@@ -613,37 +594,24 @@
 }
 
 OSystem *GameDetector::createSystem() {
-	/* auto is to use SDL */
-	switch(_gfx_driver) {
-#if defined(X11_BACKEND)
-	case GD_X:
-		return OSystem_X11_create();
+#if defined(USE_NULL_DRIVER)
+	return OSystem_NULL_create();
 #elif defined(__DC__)
-	case GD_DC:
-		return OSystem_Dreamcast_create();
-#elif defined(_WIN32_WCE)
-	case GD_WINCE:
-		return OSystem_WINCE3_create();
+	return OSystem_Dreamcast_create();
+#elif defined(X11_BACKEND)
+	return OSystem_X11_create();
 #elif defined(__MORPHOS__)
-	case GD_MORPHOS:
-		return OSystem_MorphOS_create(_gameId, _gfx_mode, _fullScreen);
+	return OSystem_MorphOS_create(_gameId, _gfx_mode, _fullScreen);
+#elif defined(_WIN32_WCE)
+	return OSystem_WINCE3_create();
 #elif defined(MACOS_CARBON)
-	case GD_MAC:
-		return OSystem_MAC_create(_gfx_mode, _fullScreen);
-#elif defined(USE_NULL_DRIVER)
-	case GD_NULL:
-		return OSystem_NULL_create();
-#elif defined(__GP32__) //ph0x
-	case GD_GP32:
-		return OSystem_GP32_create(GFX_NORMAL, true);
+	return OSystem_MAC_create(_gfx_mode, _fullScreen);
+#elif defined(__GP32__)	// ph0x
+	return OSystem_GP32_create(GFX_NORMAL, true);
 #else
-	case GD_SDL:
-		return OSystem_SDL_create(_gfx_mode, _fullScreen);
+	/* SDL is the default driver for now */
+	return OSystem_SDL_create(_gfx_mode, _fullScreen);
 #endif
-	}
-
-	error("Invalid graphics driver");
-	return NULL;
 }
 
 MidiDriver *GameDetector::createMidi() {

Index: gameDetector.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- gameDetector.h	23 Mar 2003 13:44:59 -0000	1.33
+++ gameDetector.h	25 Mar 2003 00:26:52 -0000	1.34
@@ -101,19 +101,19 @@
 	char *detectname;
 };
 
-struct MusicDrivers {
+struct MusicDriver {
 	const char *name;
 	const char *description;
 	int id;
 };
 
-struct GraphicsModes {
+struct GraphicsMode {
 	const char *name;
 	const char *description;
 	int id;
 };
 
-struct Languages {
+struct Language {
 	const char *name;
 	const char *description;
 	int id;
@@ -126,7 +126,7 @@
 	typedef ScummVM::String String;
 
 public:
-	static const MusicDrivers *getMusicDrivers();
+	static const MusicDriver *getMusicDrivers();
 	static bool isMusicDriverAvailable(int drv);
 
 public:
@@ -163,7 +163,6 @@
 	String _gameRealName;
 	uint32 _features;
 
-	int _gfx_driver;
 	int _gfx_mode;
 	bool _default_gfx_mode;
 	

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/main.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- main.cpp	24 Mar 2003 08:48:41 -0000	1.24
+++ main.cpp	25 Mar 2003 00:26:52 -0000	1.25
@@ -24,6 +24,7 @@
 #include "engine.h"
 #include "gameDetector.h"
 #include "config-file.h"
+#include "scaler.h"	// For GFX_NORMAL
 #include "gui/newgui.h"
 #include "gui/launcher.h"
 #include "gui/message.h"

Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- scaler.h	6 Mar 2003 21:45:27 -0000	1.4
+++ scaler.h	25 Mar 2003 00:26:52 -0000	1.5
@@ -41,4 +41,18 @@
 extern void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
 								uint8 *dstPtr, uint32 dstPitch, int width, int height);
 
+
+enum {
+	GFX_NORMAL = 0,
+	GFX_DOUBLESIZE = 1,
+	GFX_TRIPLESIZE = 2,
+	GFX_2XSAI = 3,
+	GFX_SUPER2XSAI = 4,
+	GFX_SUPEREAGLE = 5,
+	GFX_ADVMAME2X = 6,
+	GFX_TV2X = 7,
+	GFX_DOTMATRIX = 8
+};
+
+
 #endif

Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- system.h	23 Mar 2003 13:44:59 -0000	1.25
+++ system.h	25 Mar 2003 00:26:53 -0000	1.26
@@ -26,8 +26,6 @@
 #include "scummsys.h"
 #include "savefile.h"
 
-class Timer;
-
 // Interface to the ScummVM backend
 
 class OSystem {
@@ -210,31 +208,6 @@
 extern OSystem *OSystem_X11_create();
 extern OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen);
 extern OSystem *OSystem_GP32_create(int gfx_mode, bool full_screen); //ph0x 
-
-enum {
-	GFX_NORMAL = 0,
-	GFX_DOUBLESIZE = 1,
-	GFX_TRIPLESIZE = 2,
-	GFX_2XSAI = 3,
-	GFX_SUPER2XSAI = 4,
-	GFX_SUPEREAGLE = 5,
-	GFX_ADVMAME2X = 6,
-	GFX_TV2X = 7,
-	GFX_DOTMATRIX = 8
-};
-
-
-/* Graphics drivers */
-enum {
-	GD_NULL = 0,
-	GD_SDL,
-	GD_X,
-	GD_MORPHOS,
-	GD_WINCE,
-	GD_MAC,
-	GD_DC,
-	GD_GP32 //ph0x
-};
 
 enum {
 #ifdef _WIN32_WCE





More information about the Scummvm-git-logs mailing list