[Scummvm-cvs-logs] CVS: scummvm/backends/wince pocketpc.cpp,1.28,1.29 smartphone.cpp,1.13,1.14 wince.h,1.10,1.11

Nicolas Bacca arisme at users.sourceforge.net
Sun Oct 12 06:52:02 CEST 2003


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

Modified Files:
	pocketpc.cpp smartphone.cpp wince.h 
Log Message:
New config-manager updates, misc updates

Index: pocketpc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/pocketpc.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- pocketpc.cpp	17 Sep 2003 23:02:40 -0000	1.28
+++ pocketpc.cpp	12 Oct 2003 13:51:05 -0000	1.29
@@ -20,14 +20,17 @@
  */
 
 #include "wince.h"
+#include "scumm/scumm.h"
 
 extern bool select_game;
+extern bool _force_get_key_mapping;
 extern bool _get_key_mapping;
 extern bool draw_keyboard;
 extern bool hide_toolbar;
 extern bool freelook;
 extern bool is_simon;
 extern bool is_bass;
+extern bool is_sword2;
 extern int num_of_dirty_square;
 extern bool toolbar_drawn;
 extern Engine *engine;
@@ -69,6 +72,12 @@
 			GAPI_key = getGAPIKeyMapping((short)wParam);
 			if (GAPI_key) {
 			*/
+				if (_force_get_key_mapping) {
+                    unsigned char selected_key = GAPIKeysTranslate((unsigned int)(wParam)) & 0xff;
+					clearActionKey(selected_key);
+					getAction(ACTION_RIGHTCLICK)->action_key = selected_key;
+				}
+				else
 				if (_get_key_mapping) {
 					wm->_event.kbd.flags = 0xff;
 					wm->_event.kbd.ascii = GAPIKeysTranslate((unsigned int)(wParam));
@@ -91,6 +100,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;
@@ -246,7 +258,7 @@
 							do_quit();
 
 						wm->_event.event_code = OSystem::EVENT_KEYDOWN;
-						if (is_simon || is_bass) {
+						if (is_simon || is_bass || is_sword2) {
 							wm->_event.kbd.ascii = mapKey(VK_ESCAPE);
 							wm->_event.kbd.keycode = mapKey(VK_ESCAPE);
 							break;
@@ -260,7 +272,7 @@
 						else
 							wm->_event.kbd.ascii = mapKey(VK_ESCAPE);
 						*/
-						wm->_event.kbd.ascii = KEY_ALL_SKIP;
+						wm->_event.kbd.ascii = Scumm::KEY_ALL_SKIP;
 						break;
 					case ToolbarSound:
 						sound_activated = !sound_activated;

Index: smartphone.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/smartphone.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- smartphone.cpp	17 Sep 2003 23:02:40 -0000	1.13
+++ smartphone.cpp	12 Oct 2003 13:51:05 -0000	1.14
@@ -30,7 +30,7 @@
 
 #define IDM_SMARTFON_MAP_BASE 99200
 
-#define SCAN_LOCATION "\\Storage Card"
+#define SCAN_LOCATION ""
 
 #define KEYS_VERSION 1
 #define TOTAL_KEYS 10
@@ -71,8 +71,6 @@
 HWND _hWnd;
 HWND _hWndMenu;
 
-extern Config *g_config;
-
 int mouseX;
 int mouseY;
 int lastKeyPressed = 0;
@@ -346,7 +344,7 @@
 		else
 			wm->_event.kbd.ascii = VK_ESCAPE;						
 		*/
-		wm->_event.kbd.ascii = KEY_ALL_SKIP;
+		wm->_event.kbd.ascii = Scumm::KEY_ALL_SKIP;
 }
 
 void SmartfonBoss(OSystem_WINCE3 *wm, int repeat) {
@@ -354,8 +352,8 @@
 
 	sound_activated = false;
 	Cls();
-	g_scumm->requestSave(0, "BOSS");
-	g_scumm->scummLoop(0);
+	Scumm::g_scumm->requestSave(0, "BOSS");
+	Scumm::g_scumm->scummLoop(0);
 	dynamicGXCloseInput();
 	dynamicGXCloseDisplay();
 	SDL_AudioQuit();
@@ -461,36 +459,52 @@
 	char tempo[1024];
 	
 	tempo[0] = '\0';
-	g_config->setInt("KeysVersion", KEYS_VERSION, "smartfon");
+	ConfMan.set("KeysVersion", KEYS_VERSION, "smartfon");
 	for (i=0; i<TOTAL_KEYS; i++) {
 		 char x[4];
 		 sprintf(x, "%.4x ", current_mapping[i]);
 		 strcat(tempo, x);
 	}
-	g_config->set("ActionKeys", tempo, "smartfon");
-	g_config->flush();
+	ConfMan.set("ActionKeys", tempo, "smartfon");
+	ConfMan.flushToDisk();
 
 	return TRUE;
 }
 
 void loadKeyRepeat() {
-	repeatY = g_config->getInt("repeatY", 4, "smartfon-keys");
-	g_config->setInt("repeatY", repeatY, "smartfon-keys");
-	stepY1 = g_config->getInt("stepY1", 2, "smartfon-keys");
-	g_config->setInt("stepY1", stepY1, "smartfon-keys");
-	stepY2 = g_config->getInt("stepY2", 10, "smartfon-keys");
-	g_config->setInt("stepY2", stepY2, "smartfon-keys");
-	stepY3 = g_config->getInt("stepY3", 20, "smartfon-keys");
-	g_config->setInt("stepY3", stepY3, "smartfon-keys");
-	repeatX = g_config->getInt("repeatX", 4, "smartfon-keys");
-	g_config->setInt("repeatX", repeatX, "smartfon-keys");
-	stepX1 = g_config->getInt("stepX1", 2, "smartfon-keys");
-	g_config->setInt("stepX1", stepX1, "smartfon-keys");
-	stepX2 = g_config->getInt("stepX2", 10, "smartfon-keys");
-	g_config->setInt("stepX2", stepX2, "smartfon-keys");
-	stepX3 = g_config->getInt("stepX3", 40, "smartfon-keys");
-	g_config->setInt("stepX3", stepX3, "smartfon-keys");
-	g_config->flush();
+	repeatY = ConfMan.getInt("repeatY", "smartfon-keys");
+	if (!repeatY)
+		repeatY = 4;
+	ConfMan.set("repeatY", repeatY, "smartfon-keys");
+	stepY1 = ConfMan.getInt("stepY1", "smartfon-keys");
+	if (!stepY1)
+		stepY1 = 2;
+	ConfMan.set("stepY1", stepY1, "smartfon-keys");
+	stepY2 = ConfMan.getInt("stepY2", "smartfon-keys");
+	if (!stepY2)
+		stepY2 = 10;
+	ConfMan.set("stepY2", stepY2, "smartfon-keys");
+	stepY3 = ConfMan.getInt("stepY3", "smartfon-keys");
+	if (!stepY3)
+		stepY3 = 20;
+	ConfMan.set("stepY3", stepY3, "smartfon-keys");
+	repeatX = ConfMan.getInt("repeatX", "smartfon-keys");
+	if (!repeatX)
+		repeatX = 4;
+	ConfMan.set("repeatX", repeatX, "smartfon-keys");
+	stepX1 = ConfMan.getInt("stepX1", "smartfon-keys");
+	if (!stepX1)
+		stepX1 = 2;
+	ConfMan.set("stepX1", stepX1, "smartfon-keys");
+	stepX2 = ConfMan.getInt("stepX2", "smartfon-keys");
+	if (!stepX2)
+		stepX2 = 10;
+	ConfMan.set("stepX2", stepX2, "smartfon-keys");
+	stepX3 = ConfMan.getInt("stepX3", "smartfon-keys");
+	if (!stepX3)
+		stepX3 = 40;
+	ConfMan.set("stepX3", stepX3, "smartfon-keys");
+	ConfMan.flushToDisk();
 
 }
 
@@ -498,8 +512,8 @@
 	int version;
 	const char *current;
 
-	version = g_config->getInt("KeysVersion", 0, "smartfon");
-	current = g_config->get("ActionKeys", "smartfon");
+	version = ConfMan.getInt("KeysVersion", "smartfon");
+	current = ConfMan.get("ActionKeys", "smartfon").c_str();
 	if (current && version == KEYS_VERSION) {
 		int i;
 		for (i=0; i<TOTAL_KEYS; i++) {
@@ -591,7 +605,7 @@
 		addGames();
 
 	// See if sound is activated
-	if (g_config->getBool("Sound", true, "wince"))
+	if (ConfMan.getBool("Sound", "wince") || ConfMan.get("Sound", "wince").c_str() == NULL)
 		CheckMenuItem(optionsMenu, IDM_SMARTFON_SOUND, MF_BYCOMMAND | MF_CHECKED);
 	else
 		CheckMenuItem(optionsMenu, IDM_SMARTFON_SOUND, MF_BYCOMMAND | MF_UNCHECKED);
@@ -745,14 +759,14 @@
 					free(help);
 					break;
 				case IDM_SMARTFON_SOUND:
-					if (g_config->getBool("Sound", true, "wince")) {
+					if (ConfMan.getBool("Sound", "wince") || ConfMan.get("Sound", "wince").c_str() == NULL) {
 						sound_activated = false;
-						g_config->setBool("Sound", false, "wince");
+						ConfMan.set("Sound", false, "wince");
 						CheckMenuItem(optionsMenu, IDM_SMARTFON_SOUND, MF_BYCOMMAND | MF_UNCHECKED);
 					}
 					else {
 						sound_activated = true;
-						g_config->setBool("Sound", true, "wince");
+						ConfMan.set("Sound", true, "wince");
 						CheckMenuItem(optionsMenu, IDM_SMARTFON_SOUND, MF_BYCOMMAND | MF_CHECKED);
 					}
 					break;

Index: wince.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/wince.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- wince.h	27 Sep 2003 16:54:10 -0000	1.10
+++ wince.h	12 Oct 2003 13:51:05 -0000	1.11
@@ -38,15 +38,16 @@
 #include <gx.h>
 #include "resource.h"
 
-#include "scumm.h"
+#include "scumm/scumm.h"
 //#include "debug.h"
 #include "screen.h"
 #include "gui/newgui.h"
 #include "sound/mididrv.h"
 #include "base/engine.h"
+#include "common/timer.h"
 //#include "simon/simon.h"
 #include "gapi_keys.h"
-#include "config-file.h"
+#include "common/config-manager.h"
 
 
 #include "SDL.h"
@@ -69,7 +70,7 @@
 #include "pocketpc.h"
 #include "smartphone.h"
 
-#define MAX_NUMBER_OF_DIRTY_SQUARES 10 
+#define MAX_NUMBER_OF_DIRTY_SQUARES 32 
 
 class OSystem_WINCE3 : public OSystem {
 public:





More information about the Scummvm-git-logs mailing list