[Scummvm-cvs-logs] CVS: scummvm/backends/wince CEDevice.cpp,1.10,1.11 CEDevice.h,1.5,1.6
Nicolas Bacca
arisme at users.sourceforge.net
Sun Oct 16 15:38:51 CEST 2005
Update of /cvsroot/scummvm/scummvm/backends/wince
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9655/backends/wince
Modified Files:
CEDevice.cpp CEDevice.h
Log Message:
Newer Smartphones detection for Windows Mobile 5.0 - add some simulation options when debugging on a Pocket PC platform
Index: CEDevice.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEDevice.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- CEDevice.cpp 30 Jul 2005 21:10:55 -0000 1.10
+++ CEDevice.cpp 16 Oct 2005 22:37:17 -0000 1.11
@@ -19,6 +19,9 @@
*
*/
+//#define SIMU_SMARTPHONE 1
+//#define SIMU_SMARTPHONE_2005 1
+
#include "common/stdafx.h"
#include "CEDevice.h"
@@ -100,8 +103,12 @@
bool CEDevice::hasPocketPCResolution() {
#ifdef SIMU_SMARTPHONE
+#ifndef SIMU_SMARTPHONE_2005
return false;
#else
+ return true;
+#endif
+#else
if (OSystem_WINCE3::isOzone() && hasWideResolution())
return true;
return (OSystem_WINCE3::getScreenWidth() < 320 && OSystem_WINCE3::getScreenWidth() >= 240);
@@ -128,12 +135,28 @@
bool CEDevice::hasSmartphoneResolution() {
#ifdef SIMU_SMARTPHONE
+#ifndef SIMU_SMARTPHONE_2005
return true;
#else
+ return false;
+#endif
+#else
return (OSystem_WINCE3::getScreenWidth() < 240);
#endif
}
+bool CEDevice::isSmartphone() {
+#ifdef SIMU_SMARTPHONE
+ return true;
+#else
+ TCHAR platformType[100];
+ BOOL result = SystemParametersInfo(SPI_GETPLATFORMTYPE, sizeof(platformType), platformType, 0);
+ if (!result && GetLastError() == ERROR_ACCESS_DENIED)
+ return true;
+ return (wcsnicmp(platformType, TEXT("SmartPhone"), 10) == 0);
+#endif
+}
+
Common::String CEDevice::getKeyName(unsigned int keyCode) {
char key_name[10];
Index: CEDevice.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEDevice.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CEDevice.h 30 Jul 2005 21:10:55 -0000 1.5
+++ CEDevice.h 16 Oct 2005 22:37:17 -0000 1.6
@@ -38,6 +38,7 @@
static bool hasDesktopResolution();
static bool hasWideResolution();
static bool hasSmartphoneResolution();
+ static bool isSmartphone();
static Common::String getKeyName(unsigned int keyCode);
};
More information about the Scummvm-git-logs
mailing list