diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/commandLine.cpp | 54 | ||||
-rw-r--r-- | base/commandLine.h | 4 | ||||
-rw-r--r-- | base/internal_version.h | 2 | ||||
-rw-r--r-- | base/main.cpp | 95 | ||||
-rw-r--r-- | base/main.h | 4 | ||||
-rw-r--r-- | base/plugins.cpp | 6 | ||||
-rw-r--r-- | base/plugins.h | 6 | ||||
-rw-r--r-- | base/version.cpp | 29 | ||||
-rw-r--r-- | base/version.h | 1 |
9 files changed, 150 insertions, 51 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 42a3a64d34..285fd632b7 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -67,7 +67,7 @@ static const char HELP_STRING[] = " -h, --help Display a brief help text and exit\n" " -z, --list-games Display list of supported games and exit\n" " -t, --list-targets Display list of configured targets and exit\n" - " --list-saves=TARGET Display a list of savegames for the game (TARGET) specified\n" + " --list-saves=TARGET Display a list of saved games for the game (TARGET) specified\n" #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) " --console Enable the console window (default:enabled)\n" #endif @@ -106,7 +106,7 @@ static const char HELP_STRING[] = " --platform=WORD Specify platform of game (allowed values: 2gs, 3do,\n" " acorn, amiga, atari, c64, fmtowns, nes, mac, pc, pc98,\n" " pce, segacd, wii, windows)\n" - " --savepath=PATH Path to where savegames are stored\n" + " --savepath=PATH Path to where saved games are stored\n" " --extrapath=PATH Extra path to additional game data\n" " --soundfont=FILE Select the SoundFont for MIDI playback (only\n" " supported by some MIDI drivers)\n" @@ -118,6 +118,13 @@ static const char HELP_STRING[] = " --aspect-ratio Enable aspect ratio correction\n" " --render-mode=MODE Enable additional render modes (cga, ega, hercGreen,\n" " hercAmber, amiga)\n" +#ifdef ENABLE_EVENTRECORDER + " --record-mode=MODE Specify record mode for event recorder (record, playback,\n" + " passthrough [default])\n" + " --record-file-name=FILE Specify record file name\n" + " --disable-display Disable any gfx output. Used for headless events\n" + " playback by Event Recorder\n" +#endif "\n" #if defined(ENABLE_SKY) || defined(ENABLE_QUEEN) " --alt-intro Use alternative intro for CD versions of Beneath a\n" @@ -232,10 +239,9 @@ void registerDefaults() { ConfMan.registerDefault("confirm_exit", false); ConfMan.registerDefault("disable_sdl_parachute", false); + ConfMan.registerDefault("disable_display", false); ConfMan.registerDefault("record_mode", "none"); ConfMan.registerDefault("record_file_name", "record.bin"); - ConfMan.registerDefault("record_temp_file_name", "record.tmp"); - ConfMan.registerDefault("record_time_file_name", "record.time"); ConfMan.registerDefault("gui_saveload_chooser", "grid"); ConfMan.registerDefault("gui_saveload_last_pos", "0"); @@ -395,7 +401,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_LONG_OPTION("list-saves") // FIXME: Need to document this. - // TODO: Make the argument optional. If no argument is given, list all savegames + // TODO: Make the argument optional. If no argument is given, list all saved games // for all configured targets. return "list-saves"; END_OPTION @@ -424,6 +430,17 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_OPTION_BOOL('f', "fullscreen") END_OPTION +#ifdef ENABLE_EVENTRECORDER + DO_LONG_OPTION_INT("disable-display") + END_OPTION + + DO_LONG_OPTION("record-mode") + END_OPTION + + DO_LONG_OPTION("record-file-name") + END_OPTION +#endif + DO_LONG_OPTION("opl-driver") END_OPTION @@ -512,9 +529,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_LONG_OPTION("savepath") Common::FSNode path(option); if (!path.exists()) { - usage("Non-existent savegames path '%s'", option); + usage("Non-existent saved games path '%s'", option); } else if (!path.isWritable()) { - usage("Non-writable savegames path '%s'", option); + usage("Non-writable saved games path '%s'", option); } END_OPTION @@ -569,18 +586,6 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha END_OPTION #endif - DO_LONG_OPTION("record-mode") - END_OPTION - - DO_LONG_OPTION("record-file-name") - END_OPTION - - DO_LONG_OPTION("record-temp-file-name") - END_OPTION - - DO_LONG_OPTION("record-time-file-name") - END_OPTION - #ifdef IPHONE // This is automatically set when launched from the Springboard. DO_LONG_OPTION_OPT("launchedFromSB", 0) @@ -688,7 +693,7 @@ static Common::Error listSaves(const char *target) { return Common::Error(Common::kEnginePluginNotSupportSaves, Common::String::format("target '%s', gameid '%s", target, gameid.c_str())); } else { - // Query the plugin for a list of savegames + // Query the plugin for a list of saved games SaveStateList saveList = (*plugin)->listSaves(target); if (saveList.size() > 0) { @@ -822,9 +827,8 @@ void upgradeTargets() { printf("Upgrading all your existing targets\n"); - Common::ConfigManager::DomainMap &domains = ConfMan.getGameDomains(); - Common::ConfigManager::DomainMap::iterator iter = domains.begin(); - for (iter = domains.begin(); iter != domains.end(); ++iter) { + Common::ConfigManager::DomainMap::iterator iter = ConfMan.beginGameDomains(); + for (; iter != ConfMan.endGameDomains(); ++iter) { Common::ConfigManager::Domain &dom = iter->_value; Common::String name(iter->_key); Common::String gameid(dom.getVal("gameid")); diff --git a/base/commandLine.h b/base/commandLine.h index 2798ab0934..cf04d74c1d 100644 --- a/base/commandLine.h +++ b/base/commandLine.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/base/internal_version.h b/base/internal_version.h index 11f596df79..b6526c5c14 100644 --- a/base/internal_version.h +++ b/base/internal_version.h @@ -16,4 +16,4 @@ #define SCUMMVM_REVISION #endif -#define SCUMMVM_VERSION "1.7.0git" SCUMMVM_REVISION +#define SCUMMVM_VERSION "1.8.0git" SCUMMVM_REVISION diff --git a/base/main.cpp b/base/main.cpp index 355a65f883..3ea38b547a 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -42,8 +42,11 @@ #include "common/debug.h" #include "common/debug-channels.h" /* for debug manager */ #include "common/events.h" -#include "common/EventRecorder.h" +#include "gui/EventRecorder.h" #include "common/fs.h" +#ifdef ENABLE_EVENTRECORDER +#include "common/recorderfile.h" +#endif #include "common/system.h" #include "common/textconsole.h" #include "common/tokenizer.h" @@ -131,6 +134,19 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const Common::Error err = Common::kNoError; Engine *engine = 0; +#if defined(SDL_BACKEND) && defined(USE_OPENGL) && defined(USE_RGB_COLOR) + // HACK: We set up the requested graphics mode setting here to allow the + // backend to switch from Surface SDL to OpenGL if necessary. This is + // needed because otherwise the g_system->getSupportedFormats might return + // bad values. + g_system->beginGFXTransaction(); + g_system->setGraphicsMode(ConfMan.get("gfx_mode").c_str()); + if (g_system->endGFXTransaction() != OSystem::kTransactionSuccess) { + warning("Switching graphics mode to '%s' failed", ConfMan.get("gfx_mode").c_str()); + return Common::kUnknownError; + } +#endif + // Verify that the game path refers to an actual directory if (!(dir.exists() && dir.isDirectory())) err = Common::kPathNotDirectory; @@ -181,7 +197,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const // // Add the game path to the directory search list - SearchMan.addDirectory(dir.getPath(), dir, 0, 4); + engine->initializePath(dir); // Add extrapath (if any) to the directory search list if (ConfMan.hasKey("extrapath")) { @@ -206,7 +222,9 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const Common::StringTokenizer tokenizer(edebuglevels, " ,"); while (!tokenizer.empty()) { Common::String token = tokenizer.nextToken(); - if (!DebugMan.enableDebugChannel(token)) + if (token.equalsIgnoreCase("all")) + DebugMan.enableAllDebugChannels(); + else if (!DebugMan.enableDebugChannel(token)) warning(_("Engine does not support debug level '%s'"), token.c_str()); } @@ -305,7 +323,7 @@ static void setupKeymapper(OSystem &system) { act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys")); act->addEvent(EVENT_KEYMAPPER_REMAP); - act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen")); + act = new Action(primaryGlobalKeymap, "FULS", _("Toggle fullscreen")); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); mapper->addGlobalKeymap(primaryGlobalKeymap); @@ -409,7 +427,9 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { settings["gfx-mode"] = "default"; } } - + if (settings.contains("disable-display")) { + ConfMan.setInt("disable-display", 1, Common::ConfigManager::kTransientDomain); + } setupGraphics(system); // Init the different managers that are used by the engines. @@ -422,13 +442,15 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // take place after the backend is initiated and the screen has been setup system.getEventManager()->init(); +#ifdef ENABLE_EVENTRECORDER // Directly after initializing the event manager, we will initialize our // event recorder. // // TODO: This is just to match the current behavior, when we further extend // our event recorder, we might do this at another place. Or even change // the whole API for that ;-). - g_eventRec.init(); + g_eventRec.RegisterEventSource(); +#endif // Now as the event manager is created, setup the keymapper setupKeymapper(system); @@ -448,12 +470,29 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // to save memory PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, plugin); +#ifdef ENABLE_EVENTRECORDER + Common::String recordMode = ConfMan.get("record_mode"); + Common::String recordFileName = ConfMan.get("record_file_name"); + + if (recordMode == "record") { + g_eventRec.init(g_eventRec.generateRecordFileName(ConfMan.getActiveDomainName()), GUI::EventRecorder::kRecorderRecord); + } else if (recordMode == "playback") { + g_eventRec.init(recordFileName, GUI::EventRecorder::kRecorderPlayback); + } else if ((recordMode == "info") && (!recordFileName.empty())) { + Common::PlaybackFile record; + record.openRead(recordFileName); + debug("info:author=%s name=%s description=%s", record.getHeader().author.c_str(), record.getHeader().name.c_str(), record.getHeader().description.c_str()); + break; + } +#endif // Try to run the game Common::Error result = runGame(plugin, system, specialDebug); +#ifdef ENABLE_EVENTRECORDER // Flush Event recorder file. The recorder does not get reinitialized for next game // which is intentional. Only single game per session is allowed. g_eventRec.deinit(); +#endif #if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES) // do our best to prevent fragmentation by unloading as soon as we can @@ -478,30 +517,60 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { #ifdef FORCE_RTL g_system->getEventManager()->resetQuit(); #endif + #ifdef ENABLE_EVENTRECORDER + if (g_eventRec.checkForContinueGame()) { + continue; + } + #endif + + // At this point, we usually return to the launcher. However, the + // game may have requested that one or more other games be "chained" + // to the current one, with optional save slots to start the games + // at. At the time of writing, this is used for the Maniac Mansion + // easter egg in Day of the Tentacle. + + Common::String chainedGame; + int saveSlot = -1; + + ChainedGamesMan.pop(chainedGame, saveSlot); // Discard any command line options. It's unlikely that the user // wanted to apply them to *all* games ever launched. ConfMan.getDomain(Common::ConfigManager::kTransientDomain)->clear(); - // Clear the active config domain - ConfMan.setActiveDomain(""); + if (!chainedGame.empty()) { + if (saveSlot != -1) { + ConfMan.setInt("save_slot", saveSlot, Common::ConfigManager::kTransientDomain); + } + // Start the chained game + ConfMan.setActiveDomain(chainedGame); + } else { + // Clear the active config domain + ConfMan.setActiveDomain(""); + } PluginManager::instance().loadAllPlugins(); // only for cached manager - } else { GUI::displayErrorDialog(_("Could not find any engine capable of running the selected game")); + + // Clear the active domain + ConfMan.setActiveDomain(""); } // reset the graphics to default setupGraphics(system); - launcherDialog(); + if (0 == ConfMan.getActiveDomain()) { + launcherDialog(); + } } PluginManager::instance().unloadAllPlugins(); PluginManager::destroy(); GUI::GuiManager::destroy(); Common::ConfigManager::destroy(); Common::DebugManager::destroy(); - Common::EventRecorder::destroy(); +#ifdef ENABLE_EVENTRECORDER + GUI::EventRecorder::destroy(); +#endif Common::SearchManager::destroy(); #ifdef USE_TRANSLATION Common::TranslationManager::destroy(); diff --git a/base/main.h b/base/main.h index 3d75931454..431fcfbbed 100644 --- a/base/main.h +++ b/base/main.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/base/plugins.cpp b/base/plugins.cpp index b8cd097683..39aaf2f73e 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -295,7 +295,7 @@ bool PluginManagerUncached::loadPluginFromGameId(const Common::String &gameId) { if (domain->contains(gameId)) { Common::String filename = (*domain)[gameId]; - if (loadPluginByFileName(filename)) { + if (loadPluginByFileName(filename)) { return true; } } diff --git a/base/plugins.h b/base/plugins.h index 4409c9eaea..6037fc2d71 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -169,7 +169,7 @@ protected: PluginType _type; public: - Plugin() : _pluginObject(0) {} + Plugin() : _pluginObject(0), _type(PLUGIN_TYPE_MAX) {} virtual ~Plugin() { //if (isLoaded()) //unloadPlugin(); diff --git a/base/version.cpp b/base/version.cpp index 89fae90c2e..fcb2740de9 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -56,9 +56,18 @@ * to properly work in exports (i.e. release tar balls etc.). */ const char *gScummVMVersion = SCUMMVM_VERSION; +#ifdef __amigaos4__ +static const char *version_cookie __attribute__((used)) = "$VER: ScummVM " SCUMMVM_VERSION " (" __DATE__ ", " __TIME__ ")"; +#endif +#ifdef __PLAYSTATION2__ +const char *gScummVMBuildDate = "Git Master"; /* ScummVM Git Master */ +const char *gScummVMVersionDate = SCUMMVM_VERSION " - PlayStation2"; +const char *gScummVMFullVersion = "ScummVM " SCUMMVM_VERSION " - PlayStation2"; +#else const char *gScummVMBuildDate = __DATE__ " " __TIME__; const char *gScummVMVersionDate = SCUMMVM_VERSION " (" __DATE__ " " __TIME__ ")"; const char *gScummVMFullVersion = "ScummVM " SCUMMVM_VERSION " (" __DATE__ " " __TIME__ ")"; +#endif const char *gScummVMFeatures = "" #ifdef TAINTED_BUILD // TAINTED means the build contains engines/subengines not enabled by default @@ -129,4 +138,20 @@ const char *gScummVMFeatures = "" #ifdef USE_FREETYPE2 "FreeType2 " #endif + +#ifdef USE_JPEG + "JPEG " +#endif + +#ifdef USE_PNG + "PNG " +#endif + +#ifdef ENABLE_KEYMAPPER + "keymapper " +#endif + +#ifdef ENABLE_VKEYBD + "virtual keyboard " +#endif ; diff --git a/base/version.h b/base/version.h index a5c25c03f4..2e362b5c72 100644 --- a/base/version.h +++ b/base/version.h @@ -17,6 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * */ #ifndef BASE_VERSION_H |