- 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
This commit is contained in:
Stephen Kennedy 2008-08-18 10:07:11 +00:00
parent 63c4a61032
commit d92909203b
13 changed files with 147 additions and 111 deletions

View file

@ -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();