aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-03-25 00:26:53 +0000
committerMax Horn2003-03-25 00:26:53 +0000
commita50bbdd7f78f77c48a4ed8467e59045c32e50ce8 (patch)
tree03ff251bd73cd5b022a5ae63fde363214dbdc63d /common
parentc98130a0a68b0b605e283dacdecc1e4a21f95ba7 (diff)
downloadscummvm-rg350-a50bbdd7f78f77c48a4ed8467e59045c32e50ce8.tar.gz
scummvm-rg350-a50bbdd7f78f77c48a4ed8467e59045c32e50ce8.tar.bz2
scummvm-rg350-a50bbdd7f78f77c48a4ed8467e59045c32e50ce8.zip
cleanup
svn-id: r6856
Diffstat (limited to 'common')
-rw-r--r--common/engine.h1
-rw-r--r--common/gameDetector.cpp80
-rw-r--r--common/gameDetector.h9
-rw-r--r--common/main.cpp1
-rw-r--r--common/scaler.h14
-rw-r--r--common/system.h27
6 files changed, 44 insertions, 88 deletions
diff --git a/common/engine.h b/common/engine.h
index 3bf5f0b167..cdeab8d326 100644
--- a/common/engine.h
+++ b/common/engine.h
@@ -29,6 +29,7 @@
class SoundMixer;
class GameDetector;
+class Timer;
struct VersionSettings;
/* FIXME - BIG HACK for MidiEmu */
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index af236127f9..e878fea9e7 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -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 @@ static const char USAGE_STRING[] =
// 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 @@ static const struct GraphicsModes gfx_modes[] = {
{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 @@ static const struct Languages languages[] = {
{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 @@ GameDetector::GameDetector() {
#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 @@ void GameDetector::setGame(const String &name) {
}
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::parseGraphicsMode(const char *s) {
}
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 @@ bool GameDetector::isMusicDriverAvailable(int drv) {
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 @@ int GameDetector::detectMain() {
}
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() {
diff --git a/common/gameDetector.h b/common/gameDetector.h
index 54a192088d..fd517fff18 100644
--- a/common/gameDetector.h
+++ b/common/gameDetector.h
@@ -101,19 +101,19 @@ struct VersionSettings {
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 @@ class GameDetector {
typedef ScummVM::String String;
public:
- static const MusicDrivers *getMusicDrivers();
+ static const MusicDriver *getMusicDrivers();
static bool isMusicDriverAvailable(int drv);
public:
@@ -163,7 +163,6 @@ public:
String _gameRealName;
uint32 _features;
- int _gfx_driver;
int _gfx_mode;
bool _default_gfx_mode;
diff --git a/common/main.cpp b/common/main.cpp
index be2882271e..9e0896f108 100644
--- a/common/main.cpp
+++ b/common/main.cpp
@@ -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"
diff --git a/common/scaler.h b/common/scaler.h
index 5575639f71..9edae0c923 100644
--- a/common/scaler.h
+++ b/common/scaler.h
@@ -41,4 +41,18 @@ extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
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
diff --git a/common/system.h b/common/system.h
index 09553f5032..40e029df81 100644
--- a/common/system.h
+++ b/common/system.h
@@ -26,8 +26,6 @@
#include "scummsys.h"
#include "savefile.h"
-class Timer;
-
// Interface to the ScummVM backend
class OSystem {
@@ -212,31 +210,6 @@ 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
SAMPLES_PER_SEC_OLD = 11025,
SAMPLES_PER_SEC_NEW = 22050