diff options
author | Paweł Kołodziejski | 2003-11-08 22:05:58 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2003-11-08 22:05:58 +0000 |
commit | bd972c97e57234dadd830fef118139c0bf9c71e4 (patch) | |
tree | ab5db5620c273d29994a3719a6f3012313dd2f71 /base | |
parent | 1f9e408e2fab0f11a648d113fd7e4a19f113f234 (diff) | |
download | scummvm-rg350-bd972c97e57234dadd830fef118139c0bf9c71e4.tar.gz scummvm-rg350-bd972c97e57234dadd830fef118139c0bf9c71e4.tar.bz2 scummvm-rg350-bd972c97e57234dadd830fef118139c0bf9c71e4.zip |
cleanup whitespaces
svn-id: r11218
Diffstat (limited to 'base')
-rw-r--r-- | base/engine.cpp | 4 | ||||
-rw-r--r-- | base/gameDetector.cpp | 68 | ||||
-rw-r--r-- | base/gameDetector.h | 2 | ||||
-rw-r--r-- | base/main.cpp | 8 | ||||
-rw-r--r-- | base/plugins.cpp | 20 |
5 files changed, 47 insertions, 55 deletions
diff --git a/base/engine.cpp b/base/engine.cpp index a39ab3a09e..50bccb4746 100644 --- a/base/engine.cpp +++ b/base/engine.cpp @@ -38,7 +38,7 @@ Engine::Engine(GameDetector *detector, OSystem *syst) _mixer = detector->createMixer(); _timer = g_timer; - + // Set default file directory File::setDefaultDirectory(_gameDataPath); } @@ -121,7 +121,7 @@ void NORETURN CDECL error(const char *s, ...) { // Finally exit. quit() will terminate the program if g_system iss present if (g_system) g_system->quit(); - + exit(1); } diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index e13d20c868..6dd67aa8bf 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -225,7 +225,7 @@ GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugi // Find the GameSettings for this target const PluginList &plugins = PluginManager::instance().getPlugins(); GameSettings result = {NULL, NULL, MDT_NONE, 0, NULL}; - + PluginList::ConstIterator iter = plugins.begin(); for (iter = plugins.begin(); iter != plugins.end(); ++iter) { result = (*iter)->findGame(gameName.c_str()); @@ -238,7 +238,6 @@ GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugi return result; } - // // Various macros used by the command line parser. // @@ -280,7 +279,6 @@ GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugi continue; \ } - void GameDetector::parseCommandLine(int argc, char **argv) { int i; char *s; @@ -292,7 +290,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) { // Iterate over all command line arguments, backwards. for (i = argc - 1; i >= 1; i--) { s = argv[i]; - + if (s[0] != '-' || s[1] == '\0') { // Last argument: this could be a target name. // To verify this, check if there is either a game domain (i.e @@ -307,12 +305,12 @@ void GameDetector::parseCommandLine(int argc, char **argv) { goto ShowHelpAndExit; } } else { - + shortCmdLower = tolower(s[1]); isLongCmd = (s[0] == '-' && s[1] == '-'); cmdValue = (shortCmdLower == s[1]); s += 2; - + DO_OPTION('b', "boot-param") ConfMan.set("boot_param", (int)strtol(option, 0, 10)); END_OPTION @@ -335,11 +333,11 @@ void GameDetector::parseCommandLine(int argc, char **argv) { goto ShowHelpAndExit; ConfMan.set("music_driver", option); END_OPTION - + DO_OPTION_BOOL('f', "fullscreen") ConfMan.set("fullscreen", cmdValue); END_OPTION - + DO_OPTION('g', "gfx-mode") int gfx_mode = parseGraphicsMode(option); // TODO: Instead of just showing the generic help text, @@ -350,90 +348,90 @@ void GameDetector::parseCommandLine(int argc, char **argv) { goto ShowHelpAndExit; ConfMan.set("gfx_mode", option); END_OPTION - + DO_OPTION_CMD('h', "help") printf(USAGE_STRING); exit(0); END_OPTION - + DO_OPTION('m', "music-volume") ConfMan.set("music_volume", (int)strtol(option, 0, 10)); END_OPTION - + DO_OPTION_BOOL('n', "nosubtitles") ConfMan.set("nosubtitles", cmdValue); END_OPTION - + DO_OPTION('o', "master-volume") ConfMan.set("master_volume", (int)strtol(option, 0, 10)); END_OPTION - + DO_OPTION('p', "path") // TODO: Verify whether the path is valid ConfMan.set("path", option); END_OPTION - + DO_OPTION('q', "language") if (Common::parseLanguage(option) == Common::UNK_LANG) goto ShowHelpAndExit; ConfMan.set("language", option); END_OPTION - + DO_OPTION('s', "sfx-volume") ConfMan.set("sfx_volume", (int)strtol(option, 0, 10)); END_OPTION - + DO_OPTION_CMD('t', "list-targets") listTargets(); exit(0); END_OPTION - + DO_OPTION_BOOL('u', "dump-scripts") _dumpScripts = true; END_OPTION - + DO_OPTION_CMD('v', "version") printf("%s\n", gScummVMFullVersion); exit(0); END_OPTION - + DO_OPTION('x', "save-slot") ConfMan.set("save_slot", (option != NULL) ? (int)strtol(option, 0, 10) : 0); END_OPTION - + DO_OPTION_CMD('z', "list-games") listGames(); exit(0); END_OPTION - + DO_LONG_OPTION("cdrom") ConfMan.set("cdrom", (int)strtol(option, 0, 10)); END_OPTION - + DO_LONG_OPTION_OPT("joystick") ConfMan.set("joystick_num", (option != NULL) ? (int)strtol(option, 0, 10) : 0); END_OPTION - + DO_LONG_OPTION("platform") int platform = Common::parsePlatform(option); if (platform == Common::kPlatformUnknown) goto ShowHelpAndExit; - + ConfMan.set("platform", platform); END_OPTION - + DO_LONG_OPTION_BOOL("multi-midi") ConfMan.set("multi_midi", cmdValue); END_OPTION - + DO_LONG_OPTION_BOOL("native-mt32") ConfMan.set("native_mt32", cmdValue); END_OPTION - + DO_LONG_OPTION_BOOL("aspect-ratio") ConfMan.set("aspect_ratio", cmdValue); END_OPTION - + #ifndef DISABLE_SCUMM DO_LONG_OPTION("tempo") // Use the special value '0' for the base in (int)strtol. @@ -441,7 +439,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) { // as "0x1234", but also decimal values ("123"). ConfMan.set("tempo", (int)strtol(option, 0, 0)); END_OPTION - + DO_LONG_OPTION("talkspeed") ConfMan.set("talkspeed", (int)strtol(option, 0, 10)); END_OPTION @@ -450,18 +448,18 @@ void GameDetector::parseCommandLine(int argc, char **argv) { ConfMan.set("demo_mode", cmdValue); END_OPTION #endif - + #ifndef DISABLE_SKY DO_LONG_OPTION_BOOL("floppy-intro") ConfMan.set("floppy_intro", cmdValue); END_OPTION #endif - + // If we get till here, the option is unhandled and hence unknown. goto ShowHelpAndExit; } } - + if (current_option) { ShowHelpAndExit: printf(USAGE_STRING); @@ -498,9 +496,9 @@ bool GameDetector::detectGame() { else realGame = _targetName; printf("Looking for %s\n", realGame.c_str()); - + _game = findGame(realGame, &_plugin); - + if (_game.gameName) { printf("Trying to start game '%s'\n", _game.description); return true; @@ -534,7 +532,7 @@ int GameDetector::detectMusicDriver(int midiFlags) { // whether a sequencer is available, and use it instead. musicDriver = MD_ADLIB; #else - musicDriver = MD_NULL; + musicDriver = MD_NULL; #endif } else musicDriver = MD_ADLIB; diff --git a/base/gameDetector.h b/base/gameDetector.h index 68c7afaa79..1bad32078d 100644 --- a/base/gameDetector.h +++ b/base/gameDetector.h @@ -79,7 +79,7 @@ public: static int parseGraphicsMode(const String &s); // Used in main() static int detectMusicDriver(int midiFlags); - + static GameSettings findGame(const String &gameName, const Plugin **plugin = NULL); protected: diff --git a/base/main.cpp b/base/main.cpp index 4c335eef7e..55177783df 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -232,7 +232,7 @@ int main(int argc, char *argv[]) { // Update the config file ConfMan.set("versioninfo", gScummVMVersion, Common::ConfigManager::kApplicationDomain); - + // Load the plugins PluginManager::instance().loadPlugins(); @@ -242,7 +242,7 @@ int main(int argc, char *argv[]) { // Create the system object OSystem *system = OSystem::instance(); - + // Create the timer services g_timer = new Timer(system); @@ -270,7 +270,7 @@ int main(int argc, char *argv[]) { // See if the game should default to 1x scaler if (!ConfMan.hasKey("gfx_mode", detector._targetName) && - (detector._game.features & GF_DEFAULT_TO_1X_SCALER)) { + (detector._game.features & GF_DEFAULT_TO_1X_SCALER)) { prop.gfx_mode = GFX_NORMAL; system->property(OSystem::PROP_SET_GFX_MODE, &prop); } else @@ -279,7 +279,7 @@ int main(int argc, char *argv[]) { prop.gfx_mode = detector.parseGraphicsMode(ConfMan.get("gfx_mode")); system->property(OSystem::PROP_SET_GFX_MODE, &prop); } - + // (De)activate fullscreen mode as determined by the config settings if (ConfMan.getBool("fullscreen") != (system->property(OSystem::PROP_GET_FULLSCREEN, 0) != 0)) system->property(OSystem::PROP_TOGGLE_FULLSCREEN, 0); diff --git a/base/plugins.cpp b/base/plugins.cpp index faee80456a..9c8b61a8cf 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -48,7 +48,6 @@ typedef GameList (*DetectFunc)(const FSList &fslist); #pragma mark - - GameSettings Plugin::findGame(const char *gameName) const { // Find the GameSettings for this game assert(gameName); @@ -63,10 +62,8 @@ GameSettings Plugin::findGame(const char *gameName) const { return result; } - #pragma mark - - class StaticPlugin : public Plugin { const char *_name; EngineFactory _ef; @@ -89,10 +86,8 @@ public: } }; - #pragma mark - - #ifdef DYNAMIC_MODULES class DynamicPlugin : public Plugin { @@ -103,13 +98,13 @@ class DynamicPlugin : public Plugin { EngineFactory _ef; DetectFunc _df; GameList _games; - + void *findSymbol(const char *symbol); public: DynamicPlugin(const char *filename) : _dlHandle(0), _filename(filename), _ef(0), _df(0), _games() {} - + const char *getName() const { return _name.c_str(); } Engine *createInstance(GameDetector *detector, OSystem *syst) const { @@ -148,12 +143,12 @@ void *DynamicPlugin::findSymbol(const char *symbol) { bool DynamicPlugin::loadPlugin() { assert(!_dlHandle); _dlHandle = dlopen(_filename.c_str(), RTLD_LAZY); - + if (!_dlHandle) { warning("Failed loading plugin '%s' (%s)", _filename.c_str(), dlerror()); return false; } - + // Query the plugin's name NameFunc nameFunc = (NameFunc)findSymbol("PLUGIN_name"); if (!nameFunc) { @@ -161,7 +156,7 @@ bool DynamicPlugin::loadPlugin() { return false; } _name = nameFunc(); - + // Query the plugin for the targets it supports TargetListFunc gameListFunc = (TargetListFunc)findSymbol("PLUGIN_getSupportedGames"); if (!gameListFunc) { @@ -169,14 +164,14 @@ bool DynamicPlugin::loadPlugin() { return false; } _games = gameListFunc(); - + // Retrieve the factory function _ef = (EngineFactory)findSymbol("PLUGIN_createEngine"); if (!_ef) { unloadPlugin(); return false; } - + // Retrieve the detector function _df = (DetectFunc)findSymbol("PLUGIN_detectGames"); if (!_df) { @@ -198,7 +193,6 @@ void DynamicPlugin::unloadPlugin() { #pragma mark - - PluginManager::PluginManager() { } |