[Scummvm-cvs-logs] SF.net SVN: scummvm: [31880] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon May 5 19:18:11 CEST 2008


Revision: 31880
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31880&view=rev
Author:   lordhoto
Date:     2008-05-05 10:18:11 -0700 (Mon, 05 May 2008)

Log Message:
-----------
Got rid of some code duplication.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui_hof.cpp
    scummvm/trunk/engines/kyra/gui_hof.h
    scummvm/trunk/engines/kyra/gui_mr.cpp
    scummvm/trunk/engines/kyra/gui_mr.h
    scummvm/trunk/engines/kyra/gui_v2.cpp
    scummvm/trunk/engines/kyra/gui_v2.h

Modified: scummvm/trunk/engines/kyra/gui_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_hof.cpp	2008-05-05 17:12:48 UTC (rev 31879)
+++ scummvm/trunk/engines/kyra/gui_hof.cpp	2008-05-05 17:18:11 UTC (rev 31880)
@@ -1001,18 +1001,6 @@
 	return 0;
 }
 
-int GUI_HoF::toggleWalkspeed(Button *caller) {
-	updateMenuButton(caller);
-	if (_vm->_configWalkspeed == 5)
-		_vm->_configWalkspeed = 3;
-	else
-		_vm->_configWalkspeed = 5;
-	_vm->_timer->setDelay(0, _vm->_configWalkspeed); 
-	setupOptionsButtons();
-	renewHighlight(_gameOptions);
-	return 0;
-}
-
 int GUI_HoF::changeLanguage(Button *caller) {
 	updateMenuButton(caller);
 	++_vm->_lang;
@@ -1022,26 +1010,6 @@
 	return 0;
 }
 
-int GUI_HoF::toggleText(Button *caller) {
-	updateMenuButton(caller);
-	
-	if (_vm->textEnabled()) {
-		if (_vm->speechEnabled())
-			_vm->_configVoice = 1;
-		else
-			_vm->_configVoice = 3;
-	} else {
-		if (_vm->speechEnabled())
-			_vm->_configVoice = 2;
-		else
-			_vm->_configVoice = 0;
-	}
-
-	setupOptionsButtons();
-	renewHighlight(_gameOptions);
-	return 0;
-}
-
 void GUI_HoF::setupOptionsButtons() {
 	if (_vm->_configWalkspeed == 3)
 		_gameOptions.item[0].itemId = 28;

Modified: scummvm/trunk/engines/kyra/gui_hof.h
===================================================================
--- scummvm/trunk/engines/kyra/gui_hof.h	2008-05-05 17:12:48 UTC (rev 31879)
+++ scummvm/trunk/engines/kyra/gui_hof.h	2008-05-05 17:18:11 UTC (rev 31880)
@@ -69,9 +69,7 @@
 	int gameOptions(Button *caller);
 	int gameOptionsTalkie(Button *caller);
 
-	int toggleWalkspeed(Button *caller);
 	int changeLanguage(Button *caller);
-	int toggleText(Button *caller);
 
 	void setupOptionsButtons();
 

Modified: scummvm/trunk/engines/kyra/gui_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_mr.cpp	2008-05-05 17:12:48 UTC (rev 31879)
+++ scummvm/trunk/engines/kyra/gui_mr.cpp	2008-05-05 17:18:11 UTC (rev 31880)
@@ -1050,18 +1050,6 @@
 		_gameOptions.item[3].itemId = 17;
 }
 
-int GUI_MR::toggleWalkspeed(Button *caller) {
-	updateMenuButton(caller);
-	if (_vm->_configWalkspeed == 5)
-		_vm->_configWalkspeed = 3;
-	else
-		_vm->_configWalkspeed = 5;
-	_vm->_mainCharacter.walkspeed = _vm->_configWalkspeed;
-	setupOptionsButtons();
-	renewHighlight(_gameOptions);
-	return 0;
-}
-
 int GUI_MR::changeLanguage(Button *caller) {
 	updateMenuButton(caller);
 	if (!_vm->queryGameFlag(0x1B2)) {
@@ -1089,25 +1077,5 @@
 	return 0;
 }
 
-int GUI_MR::toggleText(Button *caller) {
-	updateMenuButton(caller);
-	
-	if (_vm->textEnabled()) {
-		if (_vm->speechEnabled())
-			_vm->_configVoice = 1;
-		else
-			_vm->_configVoice = 3;
-	} else {
-		if (_vm->speechEnabled())
-			_vm->_configVoice = 2;
-		else
-			_vm->_configVoice = 0;
-	}
-
-	setupOptionsButtons();
-	renewHighlight(_gameOptions);
-	return 0;
-}
-
 } // end of namespace Kyra
 

Modified: scummvm/trunk/engines/kyra/gui_mr.h
===================================================================
--- scummvm/trunk/engines/kyra/gui_mr.h	2008-05-05 17:12:48 UTC (rev 31879)
+++ scummvm/trunk/engines/kyra/gui_mr.h	2008-05-05 17:18:11 UTC (rev 31880)
@@ -69,11 +69,9 @@
 	int gameOptions(Button *button);
 	void setupOptionsButtons();
 
-	int toggleWalkspeed(Button *caller);
 	int changeLanguage(Button *caller);
 	int toggleStudioSFX(Button *caller);
 	int toggleSkipSupport(Button *caller);
-	int toggleText(Button *caller);
 
 	KyraEngine_MR *_vm;
 	Screen_MR *_screen;

Modified: scummvm/trunk/engines/kyra/gui_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_v2.cpp	2008-05-05 17:12:48 UTC (rev 31879)
+++ scummvm/trunk/engines/kyra/gui_v2.cpp	2008-05-05 17:18:11 UTC (rev 31880)
@@ -518,6 +518,38 @@
 	return 0;
 }
 
+int GUI_v2::toggleWalkspeed(Button *caller) {
+	updateMenuButton(caller);
+	if (_vm->_configWalkspeed == 5)
+		_vm->_configWalkspeed = 3;
+	else
+		_vm->_configWalkspeed = 5;
+	_vm->setWalkspeed(_vm->_configWalkspeed);
+	setupOptionsButtons();
+	renewHighlight(_gameOptions);
+	return 0;
+}
+
+int GUI_v2::toggleText(Button *caller) {
+	updateMenuButton(caller);
+	
+	if (_vm->textEnabled()) {
+		if (_vm->speechEnabled())
+			_vm->_configVoice = 1;
+		else
+			_vm->_configVoice = 3;
+	} else {
+		if (_vm->speechEnabled())
+			_vm->_configVoice = 2;
+		else
+			_vm->_configVoice = 0;
+	}
+
+	setupOptionsButtons();
+	renewHighlight(_gameOptions);
+	return 0;
+}
+
 int GUI_v2::clickLoadSlot(Button *caller) {
 	updateMenuButton(caller);
 

Modified: scummvm/trunk/engines/kyra/gui_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/gui_v2.h	2008-05-05 17:12:48 UTC (rev 31879)
+++ scummvm/trunk/engines/kyra/gui_v2.h	2008-05-05 17:18:11 UTC (rev 31880)
@@ -194,6 +194,11 @@
 	// options menu
 	int quitOptionsMenu(Button *caller);
 
+	int toggleWalkspeed(Button *caller);
+	int toggleText(Button *caller);
+
+	virtual void setupOptionsButtons() = 0;
+
 	// savename menu
 	bool _finishNameInput, _cancelNameInput;
 	Common::KeyState _keyPressed;


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