diff options
author | Stephen Kennedy | 2008-08-18 10:07:11 +0000 |
---|---|---|
committer | Stephen Kennedy | 2008-08-18 10:07:11 +0000 |
commit | d92909203b56d9b3fa6c4989bdeb83dbed5b94d5 (patch) | |
tree | 350de91c678c790dde49487804b02e1bb317f1d2 /base | |
parent | 63c4a61032bd97b478de9cbf82510f461d08f653 (diff) | |
download | scummvm-rg350-d92909203b56d9b3fa6c4989bdeb83dbed5b94d5.tar.gz scummvm-rg350-d92909203b56d9b3fa6c4989bdeb83dbed5b94d5.tar.bz2 scummvm-rg350-d92909203b56d9b3fa6c4989bdeb83dbed5b94d5.zip |
- proper init of virtual keyboard now implemented (involved added EventManager::init() which is called after screen has been initialised)
- changed HardwareKey / Action id field to an array of 4 chars instead of int32. Means that the keymap key/value pairs in config file are more readable.
svn-id: r33986
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/base/main.cpp b/base/main.cpp index 115a920f36..0222d61764 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -38,6 +38,7 @@ #include "base/version.h" #include "common/config-manager.h" +#include "common/events.h" #include "common/file.h" #include "common/fs.h" #include "common/system.h" @@ -54,20 +55,6 @@ static bool launcherDialog(OSystem &system) { - - system.beginGFXTransaction(); - // Set the user specified graphics mode (if any). - system.setGraphicsMode(ConfMan.get("gfx_mode").c_str()); - - system.initSize(320, 200); - system.endGFXTransaction(); - - // Set initial window caption - system.setWindowCaption(gScummVMFullVersion); - - // Clear the main screen - system.clearScreen(); - #if defined(_WIN32_WCE) CELauncherDialog dlg; #elif defined(__DC__) @@ -203,6 +190,21 @@ static int runGame(const EnginePlugin *plugin, OSystem &system, const Common::St return 0; } +static void setupGraphics(OSystem &system) { + system.beginGFXTransaction(); + // Set the user specified graphics mode (if any). + system.setGraphicsMode(ConfMan.get("gfx_mode").c_str()); + + system.initSize(320, 200); + system.endGFXTransaction(); + + // Set initial window caption + system.setWindowCaption(gScummVMFullVersion); + + // Clear the main screen + system.clearScreen(); +} + extern "C" int scummvm_main(int argc, char *argv[]) { Common::String specialDebug; @@ -259,6 +261,12 @@ extern "C" int scummvm_main(int argc, char *argv[]) { // the command line params) was read. system.initBackend(); + setupGraphics(system); + + // Init the event manager. As the virtual keyboard is loaded here, it must + // take place after the backend is initiated and the screen has been setup + system.getEventManager()->init(); + // Unless a game was specified, show the launcher dialog if (0 == ConfMan.getActiveDomain()) { launcherDialog(system); @@ -303,7 +311,9 @@ extern "C" int scummvm_main(int argc, char *argv[]) { // screen to draw on yet. warning("Could not find any engine capable of running the selected game"); } - + + // reset the graphics to default + setupGraphics(system); launcherDialog(system); } PluginManager::instance().unloadPlugins(); |