From 42ccfbfdde548e6c96cbff8238c976cc12853712 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Tue, 11 Oct 2011 17:24:00 -0500 Subject: MAEMO: Add detection for specific hardware model Features detected right now are just the hardware keyboard --- backends/platform/maemo/maemo.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'backends/platform/maemo/maemo.cpp') 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 -- cgit v1.2.3