aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/maemo/maemo.cpp
diff options
context:
space:
mode:
authorTarek Soliman2011-10-11 17:24:00 -0500
committerTarek Soliman2011-10-11 19:54:16 -0500
commit42ccfbfdde548e6c96cbff8238c976cc12853712 (patch)
treecafaa9415263ea979c9d42df85d37261e0f50444 /backends/platform/maemo/maemo.cpp
parent9fcd3ece536e5539b36ba49916c449a45b5e733e (diff)
downloadscummvm-rg350-42ccfbfdde548e6c96cbff8238c976cc12853712.tar.gz
scummvm-rg350-42ccfbfdde548e6c96cbff8238c976cc12853712.tar.bz2
scummvm-rg350-42ccfbfdde548e6c96cbff8238c976cc12853712.zip
MAEMO: Add detection for specific hardware model
Features detected right now are just the hardware keyboard
Diffstat (limited to 'backends/platform/maemo/maemo.cpp')
-rw-r--r--backends/platform/maemo/maemo.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index 1fb7ad0691..da5b61916f 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -22,6 +22,8 @@
#if defined(MAEMO)
+#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
+
#include "common/scummsys.h"
#include "common/config-manager.h"
@@ -45,6 +47,8 @@ void OSystem_SDL_Maemo::initBackend() {
ConfMan.set("vkeybdpath", DATA_PATH);
+ _maemoModel = MaemoModel(detectMaemoModel());
+
// Call parent implementation of this method
OSystem_POSIX::initBackend();
}
@@ -92,6 +96,15 @@ void OSystem_SDL_Maemo::setWindowCaption(const char *caption) {
setXWindowName(cap.c_str());
}
+const MaemoModel OSystem_SDL_Maemo::detectMaemoModel() {
+ Common::String deviceHwId = Common::String(getenv("SCUMMVM_MAEMO_DEVICE"));
+ const MaemoModel *model;
+ for (model = maemoModels; model->hwId; model++) {
+ if (deviceHwId.equals(model->hwId))
+ return *model;
+ }
+ return *model;
+}
#endif