[Scummvm-cvs-logs] CVS: scummvm/backends/wince CEActionsPocket.cpp,1.7,1.8 CEActionsSmartphone.cpp,1.4,1.5 CEDevice.cpp,1.7,1.8 CEException.cpp,1.2,1.3 CEKeysDialog.cpp,1.3,1.4 wince-sdl.cpp,1.22,1.23

Nicolas Bacca arisme at users.sourceforge.net
Fri Jan 28 15:54:28 CET 2005


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

Modified Files:
	CEActionsPocket.cpp CEActionsSmartphone.cpp CEDevice.cpp 
	CEException.cpp CEKeysDialog.cpp wince-sdl.cpp 
Log Message:
Update to latest branch fixes

Index: CEActionsPocket.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEActionsPocket.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CEActionsPocket.cpp	27 Jan 2005 21:31:38 -0000	1.7
+++ CEActionsPocket.cpp	28 Jan 2005 23:45:51 -0000	1.8
@@ -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 POCKET_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.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CEActionsSmartphone.cpp	1 Jan 2005 16:08:48 -0000	1.4
+++ CEActionsSmartphone.cpp	28 Jan 2005 23:45:51 -0000	1.5
@@ -48,7 +48,7 @@
 #ifdef SIMU_SMARTPHONE
 const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x11b, VK_LWIN, VK_ESCAPE, VK_F8 };
 #else
-const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, VK_F10 };
+const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9' };
 #endif
 
 void CEActionsSmartphone::init(GameDetector &detector) {
@@ -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) {
@@ -137,7 +137,7 @@
 	else
 		_key_action[SMARTPHONE_ACTION_SKIP].setAscii(Scumm::KEY_ALL_SKIP);
 	// Zone
-	_key_action[SMARTPHONE_ACTION_ZONE] = true;
+	_action_enabled[SMARTPHONE_ACTION_ZONE] = true;
 }
 
 
@@ -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: CEDevice.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEDevice.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CEDevice.cpp	1 Jan 2005 16:08:48 -0000	1.7
+++ CEDevice.cpp	28 Jan 2005 23:45:51 -0000	1.8
@@ -171,3 +171,4 @@
 	sprintf(key_name, "Key %.4x", keyCode);
 	return key_name;	
 }
+

Index: CEException.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEException.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CEException.cpp	1 Jan 2005 16:08:48 -0000	1.2
+++ CEException.cpp	28 Jan 2005 23:45:51 -0000	1.3
@@ -43,6 +43,7 @@
 	DWORD size;
 	unsigned int i;
 
+#ifdef ARM
 	writeBreak(file);
 	writeString(file, "Context dump");
 	sprintf(tempo, "R0=%.8x R1=%.8x R2=%.8x R3=%.8x R4=%.8x", context->R0, context->R1,
@@ -77,13 +78,17 @@
 			writeString(file, tempo);
 		}
 	}
+#else
+	writeBreak(file);
+	writeString(file, "Context dump only available on ARM devices");
+#endif
 }
 
 void CEException::dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord) {
 	char tempo[200];
 	char exceptionName[50];
 	unsigned int i;
-	
+#if (_WIN32_WCE >= 300)
 	writeBreak(file);
 	switch(exceptionRecord->ExceptionCode) {
 		case EXCEPTION_ACCESS_VIOLATION :
@@ -122,6 +127,10 @@
 	}
 	if (exceptionRecord->ExceptionRecord)
 		dumpException(file, exceptionRecord->ExceptionRecord);
+#else
+	writeBreak(file);
+	writeString(file, "Cannot get exception information on this CE version");
+#endif
 }
 
 bool CEException::writeException(TCHAR *path, EXCEPTION_POINTERS *exceptionPointers) {
@@ -143,4 +152,4 @@
 	CloseHandle(dumpFile);
 
 	return true;
-}
\ No newline at end of file
+}

Index: CEKeysDialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEKeysDialog.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CEKeysDialog.cpp	1 Jan 2005 16:08:48 -0000	1.3
+++ CEKeysDialog.cpp	28 Jan 2005 23:45:51 -0000	1.4
@@ -56,7 +56,7 @@
 	// Get actions names
 	Common::StringList l;
 
-	for (int i = 1; i < CEActions::Instance()->size(); i++) 
+	for (int i = 0; i < CEActions::Instance()->size(); i++) 
 		l.push_back(CEActions::Instance()->actionName((ActionType)i));
 
 	_actionsList->setList(l);
@@ -72,7 +72,7 @@
 		if (_actionsList->getSelected() >= 0) {
 				char selection[100];
 
-				sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)(_actionsList->getSelected() + 1))).c_str());
+				sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)(_actionsList->getSelected()))).c_str());
 				_keyMapping->setLabel(selection);
 				_keyMapping->draw();
 		}
@@ -84,7 +84,7 @@
 		else {
 				char selection[100];
 
-				_actionSelected = _actionsList->getSelected() + 1;
+				_actionSelected = _actionsList->getSelected();
 				sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)_actionSelected)).c_str());
 				_actionTitle->setLabel("Press the key to associate");
 				_keyMapping->setLabel(selection);

Index: wince-sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/wince-sdl.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- wince-sdl.cpp	4 Jan 2005 23:00:03 -0000	1.22
+++ wince-sdl.cpp	28 Jan 2005 23:45:51 -0000	1.23
@@ -118,7 +118,7 @@
 
 extern "C" int scummvm_main(GameDetector &gameDetector, int argc, char **argv);
 
-void handleException(EXCEPTION_POINTERS *exceptionPointers) {
+int handleException(EXCEPTION_POINTERS *exceptionPointers) {
 	CEException::writeException(TEXT("\\scummvmCrash"), exceptionPointers);
 	drawError("Unrecoverable exception occurred - see crash dump in latest \\scummvmCrash file");
 	fclose(stdout_file);
@@ -126,6 +126,7 @@
 	CEDevice::end();
 	SDL_Quit();
 	exit(0);
+	return EXCEPTION_EXECUTE_HANDLER;
 }
 
 int SDL_main(int argc, char **argv) {
@@ -228,6 +229,7 @@
 		loadSmartphoneConfiguration();
 	}
 
+
 }
 
 void OSystem_WINCE3::swap_panel_visibility() {
@@ -339,16 +341,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)) * _scaleFactorXm / _scaleFactorXd;
+                _mouseYZone[i] = (_zones[i].y + (_zones[i].height / 2)) * _scaleFactorYm / _scaleFactorYd;
+        }
+}
 
 void OSystem_WINCE3::loadSmartphoneConfigurationElement(String element, int &value, int defaultValue) {
 	value = ConfMan.getInt(element, "smartphone");
@@ -445,23 +447,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 +512,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" ||
@@ -814,6 +824,7 @@
 		_scaleFactorYd = 8;
 		_scalerProc = SmartphoneLandscape;
 		_modeFlags = 0;
+		initZones();
 		return true;
 	}
 //#endif
@@ -855,7 +866,7 @@
 		_scaleFactorXm = -1;
 	
 	if (CEDevice::hasPocketPCResolution() && !CEDevice::hasWideResolution() && _orientationLandscape)
-		_mode = GFX_NORMAL;
+		_mode = GFX_NORMAL; 
 	else
 		_mode = mode;
 
@@ -1487,21 +1498,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 +1527,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 +1644,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