[Scummvm-cvs-logs] CVS: scummvm/backends/wince wince-sdl.cpp,1.18.2.2,1.18.2.3 wince-sdl.h,1.12.2.2,1.12.2.3

Nicolas Bacca arisme at users.sourceforge.net
Wed Dec 22 17:15:01 CET 2004


Update of /cvsroot/scummvm/scummvm/backends/wince
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4206

Modified Files:
      Tag: branch-0-7-0
	wince-sdl.cpp wince-sdl.h 
Log Message:
Add Zone key support for Smartphones. Last commit for today

Index: wince-sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/wince-sdl.cpp,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -d -r1.18.2.2 -r1.18.2.3
--- wince-sdl.cpp	21 Dec 2004 00:28:11 -0000	1.18.2.2
+++ wince-sdl.cpp	23 Dec 2004 01:14:22 -0000	1.18.2.3
@@ -339,6 +339,16 @@
 
 //#ifdef WIN32_PLATFORM_WFSP
 // Smartphone actions
+

+void OSystem_WINCE3::initZones() {

+        int i;

+

+		_currentZone = 0;

+        for (i=0; i<TOTAL_ZONES; i++) {

+                _mouseXZone[i] = _zones[i].x + (_zones[i].width / 2);

+                _mouseYZone[i] = _zones[i].y + (_zones[i].height / 2);

+        }

+}

 
 void OSystem_WINCE3::loadSmartphoneConfigurationElement(String element, int &value, int defaultValue) {
 	value = ConfMan.getInt(element, "smartphone");
@@ -435,7 +445,24 @@
 	EventsBuffer::simulateMouseMove(x, y);
 }
 
-void OSystem_WINCE3::switch_zone() {
+void OSystem_WINCE3::switch_zone() {

+	int x,y;

+	int i;

+	retrieve_mouse_location(x, y);

+

+    for (i=0; i<TOTAL_ZONES; i++)

+		if (x >= _zones[i].x && y >= _zones[i].y &&

+			x <= _zones[i].x + _zones[i].width && y <= _zones[i].y + _zones[i].height

+		   ) {

+				_mouseXZone[i] = x;

+				_mouseYZone[i] = y;

+				break;

+		}

+	_currentZone++;

+	if (_currentZone >= TOTAL_ZONES)

+		_currentZone = 0;

+

+	EventsBuffer::simulateMouseMove(_mouseXZone[_currentZone], _mouseYZone[_currentZone]);
 }
 //#endif
 
@@ -1600,3 +1627,8 @@
 int OSystem_WINCE3::_platformScreenWidth;
 int OSystem_WINCE3::_platformScreenHeight;
 bool OSystem_WINCE3::_isOzone;
+OSystem_WINCE3::zoneDesc OSystem_WINCE3::_zones[TOTAL_ZONES] = {

+        { 0, 0, 320, 145 },

+        { 0, 145, 150, 55 },

+        { 150, 145, 170, 55 }

+};
\ No newline at end of file

Index: wince-sdl.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/wince-sdl.h,v
retrieving revision 1.12.2.2
retrieving revision 1.12.2.3
diff -u -d -r1.12.2.2 -r1.12.2.3
--- wince-sdl.h	21 Dec 2004 00:28:12 -0000	1.12.2.2
+++ wince-sdl.h	23 Dec 2004 01:14:22 -0000	1.12.2.3
@@ -34,7 +34,9 @@
 #include "CEDevice.h"
 #include "CEScaler.h"
 
-#include <SDL.h>
+#include <SDL.h>

+

+#define TOTAL_ZONES 3
 
 class OSystem_WINCE3 : public OSystem_SDL {
 public:
@@ -71,7 +73,8 @@
 	void swap_zoom_down();
 
 //#ifdef WIN32_PLATFORM_WFSP
-	// Smartphone actions
+	// Smartphone actions

+	void initZones();
 	void loadSmartphoneConfigurationElement(String element, int &value, int defaultValue);
 	void loadSmartphoneConfiguration();
 	void add_left_click(bool pushed);
@@ -180,7 +183,22 @@
 	int _stepX3;				// offset for left and right cursor moves (fastest)
 	int _stepY1;				// offset for up and down cursor moves (slowest)
 	int _stepY2;				// offset for up and down cursor moves (faster)
-	int _stepY3;				// offset for up and down cursor moves (fastest)
+	int _stepY3;				// offset for up and down cursor moves (fastest)

+

+	int _mouseXZone[TOTAL_ZONES];

+	int _mouseYZone[TOTAL_ZONES];

+	int _currentZone;

+

+	typedef struct zoneDesc {

+		    int x;

+	        int y;

+			int width;

+			int height;

+	} zoneDesc;

+

+	static zoneDesc _zones[TOTAL_ZONES];

+

+
 };
 
 #endif





More information about the Scummvm-git-logs mailing list