[Scummvm-cvs-logs] CVS: scummvm/backends/wince gapi_keys.cpp,1.4,1.4.2.1 gapi_keys.h,1.3,1.3.2.1 pocketpc.cpp,1.27,1.27.2.1 screen.cpp,1.21,1.21.2.1 screen.h,1.6,1.6.4.1 wince.cpp,1.19,1.19.2.1

Nicolas Bacca arisme at users.sourceforge.net
Tue Aug 5 15:39:05 CEST 2003


Update of /cvsroot/scummvm/scummvm/backends/wince
In directory sc8-pr-cvs1:/tmp/cvs-serv11462

Modified Files:
      Tag: branch-0-5-0
	gapi_keys.cpp gapi_keys.h pocketpc.cpp screen.cpp screen.h 
	wince.cpp 
Log Message:
Force right key association for games that need it, if it wasn't set (very nice for BASS :p)

Index: gapi_keys.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/gapi_keys.cpp,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -d -r1.4 -r1.4.2.1
--- gapi_keys.cpp	13 Jul 2003 12:30:32 -0000	1.4
+++ gapi_keys.cpp	5 Aug 2003 22:38:43 -0000	1.4.2.1
@@ -381,5 +381,8 @@
 		_actions[i].action_type = (ActionType)actionTypes[i];
 }
 
+bool isRightClickSet() {
+	return (_actions[ACTION_RIGHTCLICK].action_key);
+}
 
 #endif

Index: gapi_keys.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/gapi_keys.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -d -r1.3 -r1.3.2.1
--- gapi_keys.h	13 Jul 2003 12:30:32 -0000	1.3
+++ gapi_keys.h	5 Aug 2003 22:38:43 -0000	1.3.2.1
@@ -56,6 +56,7 @@
 void clearActionKey (unsigned char);
 const unsigned int* getActionKeys(void);
 void setActionKeys(unsigned int*);
+bool isRightClickSet(void);
 const char* getActionName(int);
 void setActionTypes(unsigned char *);
 const unsigned char* getActionTypes();

Index: pocketpc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/pocketpc.cpp,v
retrieving revision 1.27
retrieving revision 1.27.2.1
diff -u -d -r1.27 -r1.27.2.1
--- pocketpc.cpp	20 Jul 2003 23:47:39 -0000	1.27
+++ pocketpc.cpp	5 Aug 2003 22:38:43 -0000	1.27.2.1
@@ -22,6 +22,7 @@
 #include "wince.h"
 
 extern bool select_game;
+extern bool _force_get_key_mapping;
 extern bool _get_key_mapping;
 extern bool draw_keyboard;
 extern bool hide_toolbar;
@@ -69,12 +70,16 @@
 			GAPI_key = getGAPIKeyMapping((short)wParam);
 			if (GAPI_key) {
 			*/
+				if (_force_get_key_mapping) {
+					getAction(ACTION_RIGHTCLICK)->action_key = GAPIKeysTranslate((unsigned int)(wParam)) & 0xff;					
+				}
+				else
 				if (_get_key_mapping) {
 					wm->_event.kbd.flags = 0xff;
 					wm->_event.kbd.ascii = GAPIKeysTranslate((unsigned int)(wParam));
 					wm->_event.event_code = OSystem::EVENT_KEYDOWN;
 					break;
-				}					
+				}				
 				/*
 				else
 					processAction((short)wParam);
@@ -91,6 +96,9 @@
 		break;
 
 	case WM_KEYUP:
+		if (_force_get_key_mapping)
+			_force_get_key_mapping = false;
+		else
 		if (_get_key_mapping) {
 			_get_key_mapping = false;
 			wm->_event.kbd.flags = 0xff;

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/screen.cpp,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -u -d -r1.21 -r1.21.2.1
--- screen.cpp	15 Jul 2003 02:16:32 -0000	1.21
+++ screen.cpp	5 Aug 2003 22:38:43 -0000	1.21.2.1
@@ -795,6 +795,11 @@
 	pBlt_part(image_expand(item_loading), 28, 10, 100, 25, item_loading_colors, 0);
 }
 
+void drawWaitSelectKey() {
+	drawWait();
+	drawString("Press key for RIGHT CLICK", 10, 100, 2, 1);
+}
+
 void setGameSelectionPalette() {
 	int i;
 
@@ -3016,12 +3021,14 @@
 	current_y = y;
 
 	while(current_pos < strlen(str)) {
+		memset(decomp + (current_y * 320), 0, 320 * 8);
+
 		memset(substring, 0, sizeof(substring));
 		if (strlen(str + current_pos) > MAX_CHARS_PER_LINE) 
 			memcpy(substring, str + current_pos, MAX_CHARS_PER_LINE);
 		else
 			strcpy(substring, str + current_pos);
-		printString(substring, x, current_y, textcolor, highlight, 320);
+		printString(substring, x, current_y, textcolor, highlight, 320);		
 		pBlt_part(decomp + (current_y * 320), 0, current_y, 320, 8, item_startup_colors, 0);
 		current_pos += MAX_CHARS_PER_LINE;
 		current_y += 10;

Index: screen.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/screen.h,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -d -r1.6 -r1.6.4.1
--- screen.h	26 Jan 2003 21:40:05 -0000	1.6
+++ screen.h	5 Aug 2003 22:38:43 -0000	1.6.4.1
@@ -59,6 +59,7 @@
 void SetScreenMode(int mode);
 int GetScreenMode();
 void drawWait();
+void drawWaitSelectKey();
 void drawVideoDevice();
 
 void setGameSelectionPalette();

Index: wince.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/wince.cpp,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -d -r1.19 -r1.19.2.1
--- wince.cpp	22 Jul 2003 20:36:43 -0000	1.19
+++ wince.cpp	5 Aug 2003 22:38:43 -0000	1.19.2.1
@@ -433,6 +433,7 @@
 bool keyboard_override;
 
 bool _get_key_mapping;
+bool _force_get_key_mapping;
 static char _directory[MAX_PATH];
 bool select_game;
 bool need_GAPI;
@@ -459,6 +460,8 @@
 
 extern int chooseGame();
 
+void save_key_mapping();
+
 //#define SHMenuBar_GetMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU)
 
 /* Monkey Island 1 and 2 keyboard stuff (copy protection) */
@@ -871,6 +874,28 @@
 
 	keypad_init();
 	load_key_mapping();
+
+	/* See if we need to force a mapping */
+
+	if (!smartphone && (is_bass || detector._game.id == GID_SAMNMAX || detector._game.id == GID_CMI) && !isRightClickSet()) {
+		Cls();
+		drawWaitSelectKey();
+		_force_get_key_mapping = true;
+		while (_force_get_key_mapping) {
+			MSG msg;
+
+			if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 
+				Sleep(100);
+			else {
+					TranslateMessage(&msg);
+					DispatchMessage(&msg);
+			}
+		}
+
+		save_key_mapping();
+		Cls();
+		drawWait();
+	}
 
 	engine->go();
 





More information about the Scummvm-git-logs mailing list