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

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun May 28 09:30:04 CEST 2006


Revision: 22725
Author:   eriktorbjorn
Date:     2006-05-28 09:29:31 -0700 (Sun, 28 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22725&view=rev

Log Message:
-----------
Got rid of _selectedMenuItem to make LordHoto happier.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra.h
    scummvm/trunk/engines/kyra/kyra3.cpp
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h	2006-05-28 16:22:12 UTC (rev 22724)
+++ scummvm/trunk/engines/kyra/kyra.h	2006-05-28 16:29:31 UTC (rev 22725)
@@ -1052,13 +1052,12 @@
 	
 	int _musicSoundChannel;
 	const char *_menuAudioFile;
-	int _selectedMenuItem;
 	
 	// gui/menu specific
 private:
 	static const char *_mainMenuStrings[];
 	int handleMainMenu(WSAMovieV3 *logo);
-	void drawMainMenu(const char * const *strings);
+	void drawMainMenu(const char * const *strings, int select);
 	void drawMainBox(int x, int y, int w, int h, int fill);
 	
 	void gui_printString(const char *string, int x, int y, int col1, int col2, int flags, ...);

Modified: scummvm/trunk/engines/kyra/kyra3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.cpp	2006-05-28 16:22:12 UTC (rev 22724)
+++ scummvm/trunk/engines/kyra/kyra3.cpp	2006-05-28 16:29:31 UTC (rev 22725)
@@ -38,7 +38,6 @@
 	_soundDigital = 0;
 	_musicSoundChannel = -1;
 	_menuAudioFile = "TITLE1.AUD";
-	_selectedMenuItem = 0;
 }
 
 KyraEngine_v3::~KyraEngine_v3() {
@@ -226,8 +225,10 @@
 	
 	int curFrame = 29, frameAdd = 1;
 	uint32 nextRun = 0;
+
+	int selected = 0;
 	
-	drawMainMenu(strings);
+	drawMainMenu(strings, selected);
 
 #define A 0x00
 #define B 0xFF
@@ -291,11 +292,11 @@
 		if (menuRect.contains(mouseX(), mouseY())) {
 			int item = (mouseY() - menuRect.top) / fh;
 
-			if (item != _selectedMenuItem) {
-				gui_printString(strings[_selectedMenuItem], textPos, menuRect.top + _selectedMenuItem * fh, 0x80, 0, 5);
+			if (item != selected) {
+				gui_printString(strings[selected], textPos, menuRect.top + selected * fh, 0x80, 0, 5);
 				gui_printString(strings[item], textPos, menuRect.top + item * fh, 0xFF, 0, 5);
 
-				_selectedMenuItem = item;
+				selected = item;
 			}
 
 			if (_mousePressFlag) {
@@ -325,7 +326,7 @@
 	return command;
 }
 
-void KyraEngine_v3::drawMainMenu(const char * const *strings) {
+void KyraEngine_v3::drawMainMenu(const char * const *strings, int select) {
 	debugC(9, kDebugLevelMain, "KyraEngine::drawMainMenu(%p)", (const void*)strings);
 	static const uint16 menuTable[] = { 0x01, 0x04, 0x0C, 0x04, 0x00, 0x80, 0xFF, 0x00, 0x01, 0x02, 0x03 };
 	
@@ -334,7 +335,7 @@
 	
 	for (int i = 0; i < menuTable[3]; ++i) {
 		int curY = top + i * _screen->getFontHeight();
-		int color = (i == _selectedMenuItem) ? menuTable[6] : menuTable[5];
+		int color = (i == select) ? menuTable[6] : menuTable[5];
 		gui_printString(strings[i], ((_screen->_curDim->w >> 1) + _screen->_curDim->sx) << 3, curY, color, 0, 5);
 	}
 }


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