aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMax Horn2009-01-20 00:03:35 +0000
committerMax Horn2009-01-20 00:03:35 +0000
commita27e456ace3d8e6a2bc080a6282c781989b609b0 (patch)
tree8e2b807d563fac6bdd020e2218622e6adc37c13d /backends
parent57d118e9308137c62a6023323d5df9be6a429469 (diff)
downloadscummvm-rg350-a27e456ace3d8e6a2bc080a6282c781989b609b0.tar.gz
scummvm-rg350-a27e456ace3d8e6a2bc080a6282c781989b609b0.tar.bz2
scummvm-rg350-a27e456ace3d8e6a2bc080a6282c781989b609b0.zip
Some basic work on the vkeybd code
svn-id: r35931
Diffstat (limited to 'backends')
-rw-r--r--backends/module.mk7
-rw-r--r--backends/vkeybd/virtual-keyboard-gui.cpp2
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.cpp23
-rw-r--r--backends/vkeybd/virtual-keyboard.cpp19
-rw-r--r--backends/vkeybd/virtual-keyboard.h5
5 files changed, 34 insertions, 22 deletions
diff --git a/backends/module.mk b/backends/module.mk
index 5cc2d705e6..e6e0ba1a2f 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -36,7 +36,12 @@ MODULE_OBJS := \
saves/compressed/compressed-saves.o \
saves/posix/posix-saves.o \
saves/psp/psp-saves.o \
- timer/default/default-timer.o
+ timer/default/default-timer.o \
+ vkeybd/image-map.o \
+ vkeybd/polygon.o \
+ vkeybd/virtual-keyboard.o \
+ vkeybd/virtual-keyboard-gui.o \
+ vkeybd/virtual-keyboard-parser.o
# Include common rules
include $(srcdir)/rules.mk
diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp
index d6abd537c1..7718cd6293 100644
--- a/backends/vkeybd/virtual-keyboard-gui.cpp
+++ b/backends/vkeybd/virtual-keyboard-gui.cpp
@@ -28,7 +28,7 @@
#ifdef ENABLE_VKEYBD
#include "graphics/cursorman.h"
-#include "gui/newgui.h"
+#include "gui/GuiManager.h"
namespace Common {
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp
index ea484b8604..62180daef0 100644
--- a/backends/vkeybd/virtual-keyboard-parser.cpp
+++ b/backends/vkeybd/virtual-keyboard-parser.cpp
@@ -28,8 +28,8 @@
#ifdef ENABLE_VKEYBD
#include "common/keyboard.h"
-#include "graphics/imageman.h"
#include "common/util.h"
+#include "common/system.h"
namespace Common {
@@ -261,21 +261,26 @@ bool VirtualKeyboardParser::parserCallback_layout(ParserNode *node) {
return parserError("Error loading bitmap '%s'", _mode->bitmapName.c_str());
}
+ const Graphics::PixelFormat format = g_system->getOverlayFormat();
+ int r, g, b;
if (node->values.contains("transparent_color")) {
- int r, g, b;
if (!parseIntegerKey(node->values["transparent_color"].c_str(), 3, &r, &g, &b))
return parserError("Could not parse color value");
- _mode->transparentColor = g_system->RGBToColor(r, g, b);
- } else // default to purple
- _mode->transparentColor = g_system->RGBToColor(255, 0, 255);
+ } else {
+ // default to purple
+ r = 255;
+ g = 0;
+ b = 255;
+ }
+ _mode->transparentColor = Graphics::RGBToColor(r, g, b, format);
if (node->values.contains("display_font_color")) {
- int r, g, b;
if (!parseIntegerKey(node->values["display_font_color"].c_str(), 3, &r, &g, &b))
return parserError("Could not parse color value");
- _mode->displayFontColor = g_system->RGBToColor(r, g, b);
- } else
- _mode->displayFontColor = g_system->RGBToColor(0, 0, 0); // default to black
+ } else {
+ r = g = b = 0; // default to black
+ }
+ _mode->displayFontColor = Graphics::RGBToColor(r, g, b, format);
_layoutParsed = true;
diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp
index d097807c9c..09247538fb 100644
--- a/backends/vkeybd/virtual-keyboard.cpp
+++ b/backends/vkeybd/virtual-keyboard.cpp
@@ -32,7 +32,6 @@
#include "backends/vkeybd/keycode-descriptions.h"
#include "common/config-manager.h"
#include "common/fs.h"
-#include "graphics/imageman.h"
#include "common/unzip.h"
#define KEY_START_CHAR ('[')
@@ -81,25 +80,25 @@ bool VirtualKeyboard::loadKeyboardPack(String packName) {
_kbdGUI->initSize(_system->getOverlayWidth(), _system->getOverlayHeight());
- FilesystemNode *vkDir = 0;
+ FSNode vkDir;
if (ConfMan.hasKey("vkeybdpath")) {
- vkDir = new FilesystemNode(ConfMan.get("vkeybdpath"));
+ vkDir = FSNode(ConfMan.get("vkeybdpath"));
} else if (ConfMan.hasKey("extrapath")) {
- vkDir = new FilesystemNode(ConfMan.get("extrapath"));
+ vkDir = FSNode(ConfMan.get("extrapath"));
} else { // use current directory
- vkDir = new FilesystemNode(".");
+ vkDir = FSNode(".");
}
- if (vkDir->getChild(packName + ".xml").exists()) {
+ if (vkDir.getChild(packName + ".xml").exists()) {
// uncompressed keyboard pack
- if (!_parser->loadFile(vkDir->getChild(packName + ".xml")))
+ if (!_parser->loadFile(vkDir.getChild(packName + ".xml")))
return false;
- } else if (vkDir->getChild(packName + ".zip").exists()) {
+ } else if (vkDir.getChild(packName + ".zip").exists()) {
// compressed keyboard pack
#ifdef USE_ZLIB
- ZipArchive arch(vkDir->getChild(packName + ".zip").getPath().c_str());
+ ZipArchive arch(vkDir.getChild(packName + ".zip").getPath().c_str());
if (arch.hasFile(packName + ".xml")) {
if (!_parser->loadStream(arch.openFile(packName + ".xml")))
return false;
@@ -107,7 +106,7 @@ bool VirtualKeyboard::loadKeyboardPack(String packName) {
warning("Could not find %s.xml file in %s.zip keyboard pack", packName.c_str(), packName.c_str());
return false;
}
- ImageMan.addArchive(vkDir->getChild(packName + ".zip").getPath().c_str());
+ ImageMan.addArchive(vkDir.getChild(packName + ".zip").getPath().c_str());
#else
return false;
#endif
diff --git a/backends/vkeybd/virtual-keyboard.h b/backends/vkeybd/virtual-keyboard.h
index feb4480a70..6e044ee6da 100644
--- a/backends/vkeybd/virtual-keyboard.h
+++ b/backends/vkeybd/virtual-keyboard.h
@@ -35,11 +35,14 @@ class OSystem;
#include "common/events.h"
#include "common/hashmap.h"
#include "common/hash-str.h"
-#include "backends/vkeybd/image-map.h"
#include "common/keyboard.h"
#include "common/list.h"
#include "common/str.h"
+#include "backends/vkeybd/image-map.h"
+#include "graphics/surface.h"
+
+
namespace Common {
class VirtualKeyboardGUI;