[Scummvm-cvs-logs] SF.net SVN: scummvm: [21567] scummvm/trunk/backends/wince

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 2 13:45:06 CEST 2006


Revision: 21567
Author:   fingolfin
Date:     2006-04-02 13:44:07 -0700 (Sun, 02 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21567&view=rev

Log Message:
-----------
To detect specific games, you want to look at the gameid, not the targetname (which can take on arbitrary values)

Modified Paths:
--------------
    scummvm/trunk/backends/symbian/src/SymbianActions.cpp
    scummvm/trunk/backends/wince/CEActionsPocket.cpp
    scummvm/trunk/backends/wince/CEActionsSmartphone.cpp
    scummvm/trunk/backends/wince/wince-sdl.cpp
Modified: scummvm/trunk/backends/symbian/src/SymbianActions.cpp
===================================================================
--- scummvm/trunk/backends/symbian/src/SymbianActions.cpp	2006-04-02 20:43:36 UTC (rev 21566)
+++ scummvm/trunk/backends/symbian/src/SymbianActions.cpp	2006-04-02 20:44:07 UTC (rev 21567)
@@ -121,17 +121,17 @@
 }
 
 void SymbianActions::initInstanceGame() {
-	bool is_simon = (strncmp(_detector->_targetName.c_str(), "simon", 5) == 0);
-	bool is_sky = (_detector->_targetName == "sky");
-	bool is_queen = (_detector->_targetName == "queen");
-	bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0);
-	bool is_ite = ((strncmp(_detector->_targetName.c_str(), "ite", 3) == 0) ||
-				  (strncmp(_detector->_targetName.c_str(), "ihnm", 4) == 0));
+	bool is_simon = (strncmp(_detector->_gameid.c_str(), "simon", 5) == 0);
+	bool is_sky = (_detector->_gameid == "sky");
+	bool is_queen = (_detector->_gameid == "queen");
+	bool is_gob = (strncmp(_detector->_gameid.c_str(), "gob", 3) == 0);
+	bool is_ite = ((strncmp(_detector->_gameid.c_str(), "ite", 3) == 0) ||
+				  (strncmp(_detector->_gameid.c_str(), "ihnm", 4) == 0));
 	
 	Actions::initInstanceGame();
 
 	// See if a right click mapping could be needed
-	if (is_sky || _detector->_targetName == "samnmax" || is_gob)
+	if (is_sky || _detector->_gameid == "samnmax" || is_gob)
 		_right_click_needed = true;
 
 	// Initialize keys for different actions

Modified: scummvm/trunk/backends/wince/CEActionsPocket.cpp
===================================================================
--- scummvm/trunk/backends/wince/CEActionsPocket.cpp	2006-04-02 20:43:36 UTC (rev 21566)
+++ scummvm/trunk/backends/wince/CEActionsPocket.cpp	2006-04-02 20:44:07 UTC (rev 21567)
@@ -98,21 +98,21 @@
 }
 
 void CEActionsPocket::initInstanceGame() {
-	bool is_simon = (strncmp(_detector->_targetName.c_str(), "simon", 5) == 0);
-	bool is_sword1 = (_detector->_targetName == "sword1");
-	bool is_sword2 = (strcmp(_detector->_targetName.c_str(), "sword2") == 0);
-	bool is_queen = (_detector->_targetName == "queen");
-	bool is_sky = (_detector->_targetName == "sky");
-	bool is_comi = (strncmp(_detector->_targetName.c_str(), "comi", 4) == 0);
-	bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0);
-	bool is_ite = ((strncmp(_detector->_targetName.c_str(), "ite", 3) == 0) ||
-				  (strncmp(_detector->_targetName.c_str(), "ihnm", 4) == 0));
+	bool is_simon = (strncmp(_detector->_gameid.c_str(), "simon", 5) == 0);
+	bool is_sword1 = (_detector->_gameid == "sword1");
+	bool is_sword2 = (strcmp(_detector->_gameid.c_str(), "sword2") == 0);
+	bool is_queen = (_detector->_gameid == "queen");
+	bool is_sky = (_detector->_gameid == "sky");
+	bool is_comi = (strncmp(_detector->_gameid.c_str(), "comi", 4) == 0);
+	bool is_gob = (strncmp(_detector->_gameid.c_str(), "gob", 3) == 0);
+	bool is_ite = ((strncmp(_detector->_gameid.c_str(), "ite", 3) == 0) ||
+				  (strncmp(_detector->_gameid.c_str(), "ihnm", 4) == 0));
 
 	GUI_Actions::initInstanceGame();
 
 	// See if a right click mapping could be needed
 	if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob ||
-		_detector->_targetName == "samnmax")
+		_detector->_gameid == "samnmax")
 		_right_click_needed = true;
 
 	// See if a "hide toolbar" mapping could be needed

Modified: scummvm/trunk/backends/wince/CEActionsSmartphone.cpp
===================================================================
--- scummvm/trunk/backends/wince/CEActionsSmartphone.cpp	2006-04-02 20:43:36 UTC (rev 21566)
+++ scummvm/trunk/backends/wince/CEActionsSmartphone.cpp	2006-04-02 20:44:07 UTC (rev 21567)
@@ -112,17 +112,17 @@
 }
 
 void CEActionsSmartphone::initInstanceGame() {
-	bool is_simon = (strncmp(_detector->_targetName.c_str(), "simon", 5) == 0);
-	bool is_sky = (_detector->_targetName == "sky");
-	bool is_queen = (_detector->_targetName == "queen");
-	bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0);
-	bool is_ite = ((strncmp(_detector->_targetName.c_str(), "ite", 3) == 0) ||
-				  (strncmp(_detector->_targetName.c_str(), "ihnm", 4) == 0));
+	bool is_simon = (strncmp(_detector->_gameid.c_str(), "simon", 5) == 0);
+	bool is_sky = (_detector->_gameid == "sky");
+	bool is_queen = (_detector->_gameid == "queen");
+	bool is_gob = (strncmp(_detector->_gameid.c_str(), "gob", 3) == 0);
+	bool is_ite = ((strncmp(_detector->_gameid.c_str(), "ite", 3) == 0) ||
+				  (strncmp(_detector->_gameid.c_str(), "ihnm", 4) == 0));
 
 	GUI_Actions::initInstanceGame();
 
 	// See if a right click mapping could be needed
-	if (is_sky || _detector->_targetName == "samnmax" || is_gob)
+	if (is_sky || _detector->_gameid == "samnmax" || is_gob)
 		_right_click_needed = true;
 
 	// Initialize keys for different actions

Modified: scummvm/trunk/backends/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/wince/wince-sdl.cpp	2006-04-02 20:43:36 UTC (rev 21566)
+++ scummvm/trunk/backends/wince/wince-sdl.cpp	2006-04-02 20:44:07 UTC (rev 21567)
@@ -525,7 +525,7 @@
 
 void OSystem_WINCE3::get_sample_rate() {
 	// Force at least medium quality FM synthesis for FOTAQ
-	if (_gameDetector._targetName == "queen") {
+	if (_gameDetector._gameid == "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);
@@ -534,9 +534,9 @@
 	}
 	// See if the output frequency is forced by the game
 	if ((_gameDetector._game.features & Scumm::GF_DIGI_IMUSE) ||
-		_gameDetector._targetName == "queen" ||
-		strncmp(_gameDetector._targetName.c_str(), "sword", 5) == 0 ||
-		strncmp(_gameDetector._targetName.c_str(), "sky", 3) == 0)
+		_gameDetector._gameid == "queen" ||
+		strncmp(_gameDetector._gameid.c_str(), "sword", 5) == 0 ||
+		strncmp(_gameDetector._gameid.c_str(), "sky", 3) == 0)
 			_sampleRate = SAMPLES_PER_SEC_NEW;
 	else {
 		if (ConfMan.hasKey("high_sample_rate") && ConfMan.getBool("high_sample_rate"))
@@ -653,7 +653,7 @@
 void OSystem_WINCE3::check_mappings() {
 		CEActionsPocket *instance;
 
-		if (!_gameDetector._targetName.size() || GUI_Actions::Instance()->initialized())
+		if (!_gameDetector._gameid.size() || GUI_Actions::Instance()->initialized())
 			return;
 
 		GUI_Actions::Instance()->initInstanceGame();
@@ -696,7 +696,7 @@
 		}
 
 		// Extra warning for Zak Mc Kracken
-		if (strncmp(_gameDetector._targetName.c_str(), "zak", 3) == 0 &&
+		if (strncmp(_gameDetector._gameid.c_str(), "zak", 3) == 0 &&
 			!GUI_Actions::Instance()->getMapping(POCKET_ACTION_HIDE)) {
 			GUI::MessageDialog alert("Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory");
 			alert.runModal();
@@ -706,7 +706,7 @@
 
 void OSystem_WINCE3::update_game_settings() {
 	// Finish panel initialization
-	if (!_panelInitialized && _gameDetector._targetName.size()) {
+	if (!_panelInitialized && _gameDetector._gameid.size()) {
 		Panel *panel;
 		_panelInitialized = true;
 		// Add the main panel
@@ -729,7 +729,7 @@
 		_toolbarHandler.setVisible(true);
 
 		// Keyboard is active for Monkey 1 or 2 initial copy-protection
-		if (strncmp(_gameDetector._targetName.c_str(), "monkey", 6) == 0) {
+		if (strncmp(_gameDetector._gameid.c_str(), "monkey", 6) == 0) {
 			_monkeyKeyboard = true;
 			_toolbarHandler.setActive(NAME_PANEL_KEYBOARD);
 		}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list