[Scummvm-cvs-logs] CVS: scummvm/backends/wince CEActionsPocket.cpp,1.2.2.3,1.2.2.4 CEActionsSmartphone.cpp,1.1.2.2,1.1.2.3 wince-sdl.cpp,1.18.2.4,1.18.2.5

Nicolas Bacca arisme at users.sourceforge.net
Mon Jan 10 12:44:09 CET 2005


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

Modified Files:
      Tag: branch-0-7-0
	CEActionsPocket.cpp CEActionsSmartphone.cpp wince-sdl.cpp 
Log Message:
Fix possible infinite loop when using a mapped key for the same action - fix FOTAQ sound (add FM_medium_quality option) - homogenous keyboard emulation

Index: CEActionsPocket.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEActionsPocket.cpp,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -u -d -r1.2.2.3 -r1.2.2.4
--- CEActionsPocket.cpp	4 Jan 2005 22:53:15 -0000	1.2.2.3
+++ CEActionsPocket.cpp	10 Jan 2005 20:43:15 -0000	1.2.2.4
@@ -116,7 +116,7 @@
 	else
 	if (is_queen) {
 		_action_enabled[POCKET_ACTION_SAVE] = true;
-		_key_action[POCKET_ACTION_SAVE].setAscii(282); // F1 key
+		_key_action[POCKET_ACTION_SAVE].setAscii(286); // F5 key for FOTAQ
 	}
 	else
 	if (is_sky) {
@@ -165,6 +165,12 @@
 			case POCKET_ACTION_RIGHTCLICK:
 				_mainSystem->add_right_click(false);
 				return true;
+		case POCKET_ACTION_PAUSE:
+		case POCKET_ACTION_SAVE:
+		case POCKET_ACTION_SKIP:
+			EventsBuffer::simulateKey(&_key_action[action], false);
+			return true;
+
 		}
 		return false;
 	}
@@ -173,7 +179,7 @@
 		case POCKET_ACTION_PAUSE:
 		case POCKET_ACTION_SAVE:
 		case POCKET_ACTION_SKIP:
-			EventsBuffer::simulateKey(&_key_action[action]);
+			EventsBuffer::simulateKey(&_key_action[action], true);
 			return true;
 		case POCKET_ACTION_KEYBOARD:
 			_mainSystem->swap_panel();
@@ -190,9 +196,9 @@
 		case POCKET_ACTION_CURSOR:
 			_mainSystem->swap_mouse_visibility();
 			return true;
-                case ACTION_FREELOOK:
-                        _mainSystem->swap_freeLook();
-                        return true;
+        case POCKET_ACTION_FREELOOK:
+             _mainSystem->swap_freeLook();
+             return true;
 		case POCKET_ACTION_ZOOM_UP:
 			_mainSystem->swap_zoom_up();
 			return true;

Index: CEActionsSmartphone.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEActionsSmartphone.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- CEActionsSmartphone.cpp	21 Dec 2004 00:28:11 -0000	1.1.2.2
+++ CEActionsSmartphone.cpp	10 Jan 2005 20:43:15 -0000	1.1.2.3
@@ -119,7 +119,7 @@
 	else
 	if (is_queen) {
 		_action_enabled[SMARTPHONE_ACTION_SAVE] = true;
-		_key_action[SMARTPHONE_ACTION_SAVE].setAscii(282); // F1 key
+		_key_action[SMARTPHONE_ACTION_SAVE].setAscii(286); // F1 key for FOTAQ
 	}
 	else
 	if (is_sky) {
@@ -153,6 +153,10 @@
 			case SMARTPHONE_ACTION_LEFTCLICK:
 				_mainSystem->add_left_click(false);
 				return true;
+			case SMARTPHONE_ACTION_SAVE:
+			case SMARTPHONE_ACTION_SKIP:
+				EventsBuffer::simulateKey(&_key_action[action], false);
+				return true;
 		}
 		return false;
 	}
@@ -160,7 +164,7 @@
 	switch (action) {
 		case SMARTPHONE_ACTION_SAVE:
 		case SMARTPHONE_ACTION_SKIP:
-			EventsBuffer::simulateKey(&_key_action[action]);
+			EventsBuffer::simulateKey(&_key_action[action], true);
 			return true;
 		case SMARTPHONE_ACTION_RIGHTCLICK:
 			_mainSystem->add_right_click(true);

Index: wince-sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/wince-sdl.cpp,v
retrieving revision 1.18.2.4
retrieving revision 1.18.2.5
diff -u -d -r1.18.2.4 -r1.18.2.5
--- wince-sdl.cpp	4 Jan 2005 23:02:32 -0000	1.18.2.4
+++ wince-sdl.cpp	10 Jan 2005 20:43:15 -0000	1.18.2.5
@@ -339,16 +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::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");
@@ -445,23 +445,23 @@
 	EventsBuffer::simulateMouseMove(x, y);
 }
 
-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;

-

+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
@@ -510,6 +510,14 @@
 #endif
 
 void OSystem_WINCE3::get_sample_rate() {
+	// Force at least medium quality FM synthesis for FOTAQ
+	if (_gameDetector._targetName == "queen") {
+		if (!((ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) ||
+			(ConfMan.hasKey("FM_medium_quality") && ConfMan.getBool("FM_medium_quality")))) {
+			ConfMan.set("FM_medium_quality", true);
+			ConfMan.flushToDisk();
+		}
+	}
 	// See if the output frequency is forced by the game
 	if ((_gameDetector._game.features & Scumm::GF_DIGI_IMUSE) ||
 		_gameDetector._targetName == "queen" ||
@@ -855,7 +863,7 @@
 		_scaleFactorXm = -1;
 	
 	if (CEDevice::hasPocketPCResolution() && !CEDevice::hasWideResolution() && _orientationLandscape)
-		_mode = GFX_NORMAL;
+		_mode = GFX_NORMAL; 
 	else
 		_mode = mode;
 
@@ -1487,21 +1495,24 @@
 
 	CEDevice::wakeUp();
 
-	if (isSmartphone)
+	if (_isSmartphone)
 		currentTime = GetTickCount();
 
 	while(SDL_PollEvent(&ev)) {
 		switch(ev.type) {
 		case SDL_KEYDOWN:
-			if (_isSmartphone) {
-				keyEvent = true;			
-				_lastKeyPressed = ev.key.keysym.sym;
-				_keyRepeatTime = currentTime;
-				_keyRepeat = 0;
-			}
+			// KMOD_RESERVED is used if the key has been injected by an external buffer
+			if (ev.key.keysym.mod != KMOD_RESERVED) {
+				if (_isSmartphone) {
+					keyEvent = true;			
+					_lastKeyPressed = ev.key.keysym.sym;
+					_keyRepeatTime = currentTime;
+					_keyRepeat = 0;
+				}
 
-			if (CEActions::Instance()->performMapped(ev.key.keysym.sym, true))
-				return true;
+				if (CEActions::Instance()->performMapped(ev.key.keysym.sym, true))
+					return true;
+			}
 
 			event.type = EVENT_KEYDOWN;
 			event.kbd.keycode = ev.key.keysym.sym;
@@ -1513,13 +1524,16 @@
 			return true;
 	
 		case SDL_KEYUP:			
-			if (_isSmartphone) {
-				keyEvent = true;
-				_lastKeyPressed = 0;
-			}
+			// KMOD_RESERVED is used if the key has been injected by an external buffer
+			if (ev.key.keysym.mod != KMOD_RESERVED) { 
+				if (_isSmartphone) {
+					keyEvent = true;
+					_lastKeyPressed = 0;
+				}
 
-			if (CEActions::Instance()->performMapped(ev.key.keysym.sym, false))
-				return true;
+				if (CEActions::Instance()->performMapped(ev.key.keysym.sym, false))
+					return true;
+			}
 			
 			event.type = EVENT_KEYUP;
 			event.kbd.keycode = ev.key.keysym.sym;
@@ -1627,8 +1641,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 }

+OSystem_WINCE3::zoneDesc OSystem_WINCE3::_zones[TOTAL_ZONES] = {
+        { 0, 0, 320, 145 },
+        { 0, 145, 150, 55 },
+        { 150, 145, 170, 55 }
 };





More information about the Scummvm-git-logs mailing list