[Scummvm-cvs-logs] CVS: scummvm/backends/wince CEActionsPocket.cpp,1.15.2.2,1.15.2.3 CEActionsPocket.h,1.6.2.2,1.6.2.3 CEActionsSmartphone.cpp,1.12.2.2,1.12.2.3 CEActionsSmartphone.h,1.6.2.2,1.6.2.3 PocketSCUMM.rc,1.9,1.9.6.1 resource.h,1.8,1.8.2.1 wince-sdl.cpp,1.32.2.2,1.32.2.3

Nicolas Bacca arisme at users.sourceforge.net
Fri Jan 27 04:34:01 CET 2006


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

Modified Files:
      Tag: branch-0-8-0
	CEActionsPocket.cpp CEActionsPocket.h CEActionsSmartphone.cpp 
	CEActionsSmartphone.h PocketSCUMM.rc resource.h wince-sdl.cpp 
Log Message:
Add Knakos patch for 0.8.1 (bind key for smartphones, bind key icon, QVGA smartphones detection, double-tap tweaks), fix disappearing menus (next popular forum question : how can I leave the load screen :p)

Index: CEActionsPocket.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEActionsPocket.cpp,v
retrieving revision 1.15.2.2
retrieving revision 1.15.2.3
diff -u -d -r1.15.2.2 -r1.15.2.3
--- CEActionsPocket.cpp	18 Jan 2006 18:07:25 -0000	1.15.2.2
+++ CEActionsPocket.cpp	27 Jan 2006 12:33:05 -0000	1.15.2.3
@@ -30,6 +30,8 @@
 
 #include "common/config-manager.h"
 
+#include "gui/KeysDialog.h"
+
 #ifdef _WIN32_WCE
 #define		KEY_ALL_SKIP	3457
 #endif
@@ -47,7 +49,8 @@
 	"Free look",
 	"Zoom up",
 	"Zoom down",
-	"FT Cheat"
+	"FT Cheat",
+	"Bind Keys"
 };
 
 void CEActionsPocket::init(GameDetector &detector) {
@@ -165,6 +168,8 @@
 	// FT Cheat
 	_action_enabled[POCKET_ACTION_FT_CHEAT] = true;
 	_key_action[POCKET_ACTION_FT_CHEAT].setAscii(86); // shift-V
+	// Key bind method
+	_action_enabled[POCKET_ACTION_BINDKEYS] = true;
 }
 
 
@@ -172,6 +177,8 @@
 }
 
 bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
+	static bool keydialogrunning = false;
+
 	if (!pushed) {
 		switch(action) {
 			case POCKET_ACTION_RIGHTCLICK:
@@ -220,9 +227,20 @@
 			_CESystem->swap_zoom_down();
 			return true;
 		case POCKET_ACTION_QUIT:
-			GUI::MessageDialog alert("Do you want to quit ?", "Yes", "No");
-			if (alert.runModal() == GUI::kMessageOK)
-				_mainSystem->quit();
+			{
+				GUI::MessageDialog alert("Do you want to quit ?", "Yes", "No");
+				if (alert.runModal() == GUI::kMessageOK)
+					_mainSystem->quit();
+				return true;
+			}
+		case POCKET_ACTION_BINDKEYS:
+			if (!keydialogrunning) {
+				keydialogrunning = true;
+				GUI::KeysDialog *keysDialog = new GUI::KeysDialog();
+				keysDialog->runModal();
+				delete keysDialog;
+				keydialogrunning = false;
+			}
 			return true;
 	}
 	return false;

Index: CEActionsPocket.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEActionsPocket.h,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -u -d -r1.6.2.2 -r1.6.2.3
--- CEActionsPocket.h	18 Jan 2006 18:07:25 -0000	1.6.2.2
+++ CEActionsPocket.h	27 Jan 2006 12:33:05 -0000	1.6.2.3
@@ -46,11 +46,12 @@
         POCKET_ACTION_RIGHTCLICK,
         POCKET_ACTION_CURSOR,
         POCKET_ACTION_FREELOOK,
-	POCKET_ACTION_ZOOM_UP,
-	POCKET_ACTION_ZOOM_DOWN,
-	POCKET_ACTION_FT_CHEAT,
+		POCKET_ACTION_ZOOM_UP,
+		POCKET_ACTION_ZOOM_DOWN,
+		POCKET_ACTION_FT_CHEAT,
+		POCKET_ACTION_BINDKEYS,
 
-	POCKET_ACTION_LAST
+		POCKET_ACTION_LAST
 };
 
 class CEActionsPocket : public GUI::Actions {

Index: CEActionsSmartphone.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEActionsSmartphone.cpp,v
retrieving revision 1.12.2.2
retrieving revision 1.12.2.3
diff -u -d -r1.12.2.2 -r1.12.2.3
--- CEActionsSmartphone.cpp	18 Jan 2006 18:07:25 -0000	1.12.2.2
+++ CEActionsSmartphone.cpp	27 Jan 2006 12:33:05 -0000	1.12.2.3
@@ -33,6 +33,8 @@
 
 #include "common/config-manager.h"
 
+#include "gui/KeysDialog.h"
+
 #ifdef _WIN32_WCE
 #define		KEY_ALL_SKIP	3457
 #endif
@@ -47,13 +49,14 @@
 	"Save",
 	"Skip",
 	"Zone",
-	"FT Cheat"
+	"FT Cheat",
+	"Bind Keys"
 };
 
 #ifdef SIMU_SMARTPHONE
-const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x11b, VK_LWIN, VK_ESCAPE, VK_F8, 0 };
+const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x11b, VK_LWIN, VK_ESCAPE, VK_F8, 0, VK_RETURN };
 #else
-const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9', 0 };
+const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9', 0, VK_RETURN };
 #endif
 
 void CEActionsSmartphone::init(GameDetector &detector) {
@@ -150,6 +153,8 @@
 	// FT Cheat
 	_action_enabled[SMARTPHONE_ACTION_FT_CHEAT] = true;
 	_key_action[SMARTPHONE_ACTION_FT_CHEAT].setAscii(86); // shift-V
+	// Bind keys
+	_action_enabled[SMARTPHONE_ACTION_BINDKEYS] = true;
 }
 
 
@@ -157,6 +162,8 @@
 }
 
 bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {
+	static bool keydialogrunning = false;
+
 	if (!pushed) {
 		switch (action) {
 			case SMARTPHONE_ACTION_RIGHTCLICK:
@@ -201,6 +208,15 @@
 		case SMARTPHONE_ACTION_ZONE:
 			_CESystem->switch_zone();
 			return true;
+		case SMARTPHONE_ACTION_BINDKEYS:
+			if (!keydialogrunning) {
+				keydialogrunning = true;
+				GUI::KeysDialog *keysDialog = new GUI::KeysDialog();
+				keysDialog->runModal();
+				delete keysDialog;
+				keydialogrunning = false;
+			}
+			return true;
 	}
 
 	return false;

Index: CEActionsSmartphone.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEActionsSmartphone.h,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -u -d -r1.6.2.2 -r1.6.2.3
--- CEActionsSmartphone.h	18 Jan 2006 18:07:25 -0000	1.6.2.2
+++ CEActionsSmartphone.h	27 Jan 2006 12:33:05 -0000	1.6.2.3
@@ -47,9 +47,10 @@
         SMARTPHONE_ACTION_SAVE,
         SMARTPHONE_ACTION_SKIP,
         SMARTPHONE_ACTION_ZONE,
-	SMARTPHONE_ACTION_FT_CHEAT,
+		SMARTPHONE_ACTION_FT_CHEAT,
+		SMARTPHONE_ACTION_BINDKEYS,
 
-	SMARTPHONE_ACTION_LAST
+		SMARTPHONE_ACTION_LAST
 };
 
 

Index: PocketSCUMM.rc
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/PocketSCUMM.rc,v
retrieving revision 1.9
retrieving revision 1.9.6.1
diff -u -d -r1.9 -r1.9.6.1
--- PocketSCUMM.rc	26 Jan 2004 08:15:50 -0000	1.9
+++ PocketSCUMM.rc	27 Jan 2006 12:33:05 -0000	1.9.6.1
@@ -114,6 +114,7 @@
 ITEM_SOUND_OFF          BINARY  DISCARDABLE     "images\\SoundOff.bmp"
 ITEM_VIEW_PORTRAIT      BINARY  DISCARDABLE     "images\\MonkeyPortrait.bmp"
 ITEM_VIEW_LANDSCAPE     BINARY  DISCARDABLE     "images\\MonkeyLandscape.bmp"
+ITEM_BINDKEYS           BINARY  DISCARDABLE     "images\\bindkeys.bmp"
 
 /////////////////////////////////////////////////////////////////////////////
 //

Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/resource.h,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -d -r1.8 -r1.8.2.1
--- resource.h	30 Jul 2005 21:10:56 -0000	1.8
+++ resource.h	27 Jan 2006 12:33:05 -0000	1.8.2.1
@@ -1,38 +1,39 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft eMbedded Visual C++ generated include file.
-// Used by PocketSCUMM.rc
-//
-#define IDI_POCKETSCUMM                 101
-#define IDR_SMARTFON_MENUBAR_GAMES      102
-#define IDR_SMARTFON_MENUBAR_OPTIONS    103
-#define IDB_LOGO                        106
-#define IMAGE_PANEL                     109
-#define PANEL_GENERIC                   109
-#define IMAGE_KEYBOARD                  110
-#define PANEL_KEYBOARD                  110
-#define ITEM_SKIP                       114
-#define ITEM_OPTIONS                    115
-#define ITEM_SOUND_ON                   118
-#define ITEM_SOUND_OFF                  119
-#define ITEM_VIEW_PORTRAIT              120
-#define ITEM_VIEW_LANDSCAPE             122
-#define IDS_CAP_MENUITEM40002           40003
-#define ID_MENU_GAMES                   40006
-#define IDM_SMARTFON_SCAN               40007
-#define IDM_SMARTFON_QUIT               40009
-#define IDS_CAP_OPTIONS                 40015
-#define ID_MENU_OPTIONS                 40016
-#define IDM_SMARTFON_MUSIC              40017
-#define IDM_SMARTFON_SOUND              40017
-#define IDM_SMARTFON_HELP               40021
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        123
-#define _APS_NEXT_COMMAND_VALUE         40022
-#define _APS_NEXT_CONTROL_VALUE         1000
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft eMbedded Visual C++ generated include file.
+// Used by PocketSCUMM.rc
+//
+#define IDI_POCKETSCUMM                 101
+#define IDR_SMARTFON_MENUBAR_GAMES      102
+#define IDR_SMARTFON_MENUBAR_OPTIONS    103
+#define IDB_LOGO                        106
+#define IMAGE_PANEL                     109
+#define PANEL_GENERIC                   109
+#define IMAGE_KEYBOARD                  110
+#define PANEL_KEYBOARD                  110
+#define ITEM_SKIP                       114
+#define ITEM_OPTIONS                    115
+#define ITEM_SOUND_ON                   118
+#define ITEM_SOUND_OFF                  119
+#define ITEM_VIEW_PORTRAIT              120
+#define ITEM_VIEW_LANDSCAPE             122
+#define ITEM_BINDKEYS                   125
+#define IDS_CAP_MENUITEM40002           40003
+#define ID_MENU_GAMES                   40006
+#define IDM_SMARTFON_SCAN               40007
+#define IDM_SMARTFON_QUIT               40009
+#define IDS_CAP_OPTIONS                 40015
+#define ID_MENU_OPTIONS                 40016
+#define IDM_SMARTFON_MUSIC              40017
+#define IDM_SMARTFON_SOUND              40017
+#define IDM_SMARTFON_HELP               40021
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        126
+#define _APS_NEXT_COMMAND_VALUE         40022
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif

Index: wince-sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/wince-sdl.cpp,v
retrieving revision 1.32.2.2
retrieving revision 1.32.2.3
diff -u -d -r1.32.2.2 -r1.32.2.3
--- wince-sdl.cpp	18 Jan 2006 18:07:25 -0000	1.32.2.2
+++ wince-sdl.cpp	27 Jan 2006 12:33:05 -0000	1.32.2.3
@@ -38,7 +38,7 @@
 #include "CEActionsPocket.h"
 #include "CEActionsSmartphone.h"
 #include "ItemAction.h"
-#include "gui/KeysDialog.h"
+#include "gui/KeysDialog.h" 
 
 #include "gui/message.h"
 
@@ -48,7 +48,7 @@
 #include "CEException.h"
 
 #ifdef USE_VORBIS
-#include <vorbis/vorbisfile.h>
+#include <tremor/vorbisfile.h>
 #endif
 
 using namespace CEGUI;
@@ -63,6 +63,7 @@
 #define NAME_ITEM_SKIP			"Skip"
 #define NAME_ITEM_SOUND			"Sound"
 #define NAME_ITEM_ORIENTATION	"Orientation"
+#define NAME_ITEM_BINDKEYS		"Bindkeys"
 
 // Given to the true main, needed for backend adaptation
 
@@ -116,6 +117,26 @@
 
 // ********************************************************************************************
 
+// Dummy SDL functions
+
+
+void SDL_CDClose(SDL_CD *cdrom) {
+}
+int SDL_CDStop(SDL_CD *cdrom) {
+	return CD_ERROR;
+}
+SDL_CD *SDL_CDOpen(int drive) { 
+	return NULL;
+}
+int SDL_CDPlayTracks(SDL_CD *cdrom, int strack, int sframe, int ntracks, int nframes) {
+	return CD_ERROR;
+}
+CDstatus SDL_CDStatus(SDL_CD *cdrom) {
+	return CD_ERROR;
+}
+
+// ********************************************************************************************
+
 // MAIN
 
 extern "C" int scummvm_main(GameDetector &gameDetector, int argc, char **argv);
@@ -214,10 +235,11 @@
 	_orientationLandscape(false), _newOrientation(false), _panelInitialized(false),
 	_panelVisible(false), _panelStateForced(false), _forceHideMouse(false),
 	_freeLook(false), _forcePanelInvisible(false), _toolbarHighDrawn(false), _zoomUp(false), _zoomDown(false),
-	_scalersChanged(false), _monkeyKeyboard(false), _lastKeyPressed(0), _tapTime(0)
+	_scalersChanged(false), _monkeyKeyboard(false), _lastKeyPressed(0), _tapTime(0),
+	_saveToolbarState(false), _saveActiveToolbar(NAME_MAIN_PANEL)
 {
 	_isSmartphone = CEDevice::isSmartphone();
-	_hasSmartphoneResolution = CEDevice::hasSmartphoneResolution();
+	_hasSmartphoneResolution = CEDevice::hasSmartphoneResolution() || CEDevice::isSmartphone();
 	memset(&_mouseCurState, 0, sizeof(_mouseCurState));
 	if (_isSmartphone) {
 		_mouseCurState.x = 20;
@@ -238,7 +260,16 @@
 
 void OSystem_WINCE3::swap_panel_visibility() {
 	if (!_forcePanelInvisible && !_panelStateForced) {
-		_panelVisible = !_panelVisible;
+		if (_panelVisible) {
+			if (_toolbarHandler.activeName() == NAME_PANEL_KEYBOARD)
+				_panelVisible = !_panelVisible;
+			else
+				_toolbarHandler.setActive(NAME_PANEL_KEYBOARD);
+		}
+		else {
+			_toolbarHandler.setActive(NAME_MAIN_PANEL);
+			_panelVisible = !_panelVisible;
+		}
 		_toolbarHandler.setVisible(_panelVisible);
 		if (_screenHeight > 240)
 			addDirtyRect(0, 400, 640, 80);
@@ -703,7 +734,7 @@
 		Panel *panel;
 		_panelInitialized = true;
 		// Add the main panel
-		panel = new Panel(10, 40);
+		panel = new Panel(0, 32);
 		panel->setBackground(IMAGE_PANEL);
 		// Save
 		panel->add(NAME_ITEM_OPTIONS, new ItemAction(ITEM_OPTIONS, POCKET_ACTION_SAVE));
@@ -711,6 +742,8 @@
 		panel->add(NAME_ITEM_SKIP, new ItemAction(ITEM_SKIP, POCKET_ACTION_SKIP));
 		// sound
 		panel->add(NAME_ITEM_SOUND, new ItemSwitch(ITEM_SOUND_OFF, ITEM_SOUND_ON, &_soundMaster));
+		// knakos patch : bind key icon
+		panel->add(NAME_ITEM_BINDKEYS, new ItemAction(ITEM_BINDKEYS, POCKET_ACTION_BINDKEYS));
 		// portrait/landscape - screen dependant
 		// FIXME : will still display the portrait/landscape icon when using a scaler (but will be disabled)
 		if (_screenWidth <= 320 && (isOzone() || !CEDevice::hasDesktopResolution())) {
@@ -735,6 +768,8 @@
 		if (_hasSmartphoneResolution)
 			panel->setVisible(false);
 
+		_saveToolbarState = true;
+
 		// Set Smush Force Redraw rate for Full Throttle
 		if (!ConfMan.hasKey("Smush_force_redraw")) {
 			ConfMan.set("Smush_force_redraw", 30);
@@ -750,6 +785,9 @@
 	if (_hasSmartphoneResolution && h == 240)
 		h = 200;  // mainly for the launcher
 
+	if (_isSmartphone)
+		ConfMan.set("landscape", true);
+
 	switch (_transactionMode) {
 		case kTransactionActive:
 			_transactionDetails.w = w;
@@ -830,7 +868,7 @@
 	}
 
 //#ifdef WIN32_PLATFORM_WFSP
-	if (_hasSmartphoneResolution) {
+	if (CEDevice::hasSmartphoneResolution()) {
 		if (_screenWidth > 320)
 			error("Game resolution not supported on Smartphone");
 		_scaleFactorXm = 2;
@@ -1162,11 +1200,14 @@
 void OSystem_WINCE3::update_keyboard() {
 
 	// Update the forced keyboard for Monkey Island copy protection
+	if (_monkeyKeyboard) {
+		_toolbarHandler.setVisible(true);
+	}
 	if (_monkeyKeyboard && Scumm::g_scumm->VAR_ROOM != 0xff && Scumm::g_scumm && Scumm::g_scumm->VAR(Scumm::g_scumm->VAR_ROOM) != 108 &&
 		Scumm::g_scumm->VAR(Scumm::g_scumm->VAR_ROOM) != 90) {
 			// Switch back to the normal panel now that the keyboard is not used anymore
 			_monkeyKeyboard = false;
-			_toolbarHandler.setActive(NAME_MAIN_PANEL);
+			_toolbarHandler.setActive(NAME_MAIN_PANEL);		 
 	}
 }
 
@@ -2004,7 +2045,6 @@
 
 	if (!keyEvent) {
 		if (_isSmartphone) {
-
 			if (_lastKeyPressed) {
 				if (currentTime > _keyRepeatTime + _keyRepeatTrigger) {
 					_keyRepeatTime = currentTime;





More information about the Scummvm-git-logs mailing list