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

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Tue Apr 25 08:43:10 CEST 2006


Revision: 22153
Author:   vinterstum
Date:     2006-04-25 08:42:37 -0700 (Tue, 25 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22153&view=rev

Log Message:
-----------
Fixes some coordinate initialization in the menus, and makes sure the initial savegame is created when kyrandia is started for the first time

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui.cpp
    scummvm/trunk/engines/kyra/kyra.cpp
Modified: scummvm/trunk/engines/kyra/gui.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui.cpp	2006-04-25 15:20:46 UTC (rev 22152)
+++ scummvm/trunk/engines/kyra/gui.cpp	2006-04-25 15:42:37 UTC (rev 22153)
@@ -660,7 +660,7 @@
 	assert(menu.nrOfItems < 7);
 
 	int maxOffset = 0;
-	int x1, x2, y1, y2, textX;
+	int x1, x2, y1, y2;	
 	for (int i = 0; i < menu.nrOfItems; i++) {
 		if (menu.item[i].x == -1)
 			menu.item[i].x = (menu.width - menu.item[i].width)/2;
@@ -673,16 +673,13 @@
 			y2 = y1 + menu.item[i].height - 1;
 
 			int textWidth = _screen->getTextWidth(menu.item[i].labelString);
-
-			if (menu.item[i].field_12 != -1)
-				textX = x1 + menu.item[i].field_12 + 3;
-			else
-				textX = _text->getCenterStringX(menu.item[i].labelString, x1, x2);
-
+			int menu_x1 = (320 - menu.width) / 2;
+			int textX = menu.item[i].labelX + menu_x1;
 			int offset;
+
 			if (textWidth + textX > x1) {
-				offset = x1 - (textWidth + textX) / 2 + 10;
-				menu.width += offset;
+				offset = (textWidth + textX) - x1;
+				menu.width += offset/2;
 				
 				if (maxOffset < offset)
 					maxOffset = offset;
@@ -692,7 +689,7 @@
 
 	if (maxOffset > 0)
 		for (int i = 0; i < menu.nrOfItems; i++)
-			menu.item[i].x += maxOffset * 2;
+			menu.item[i].x += maxOffset - 10;
 			
 	if (menu.width > 310)
 		menu.width = 310;
@@ -1072,11 +1069,11 @@
 	_screen->savePageToDisk("SEENPAGE.TMP", 0);
 
 	if (_features & GF_TALKIE) {
-		_menu[5].width = 230;
+		//_menu[5].width = 230;
 
 		for (int i = 0; i < 5; i++) {
-			_menu[5].item[i].labelX = 24;
-			_menu[5].item[i].x = 115;
+			//_menu[5].item[i].labelX = 24;
+			//_menu[5].item[i].x = 115;
 			_menu[5].item[i].width = 94;
 		}
 

Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp	2006-04-25 15:20:46 UTC (rev 22152)
+++ scummvm/trunk/engines/kyra/kyra.cpp	2006-04-25 15:42:37 UTC (rev 22153)
@@ -589,7 +589,7 @@
 		setGameFlag(0xFD);
 		setGameFlag(0xEF);
 		seq_intro();
-		if (_skipIntroFlag &&_abortIntroFlag)
+		if (_skipIntroFlag && _abortIntroFlag)
 			resetGameFlag(0xEF);
 		startup();
 		resetGameFlag(0xEF);
@@ -669,7 +669,7 @@
 	snd_playTheme(1);
 	enterNewScene(_currentCharacter->sceneId, _currentCharacter->facing, 0, 0, 1);
 	
-	if (_abortIntroFlag && _skipFlag) {
+	if (_abortIntroFlag && _skipIntroFlag) {
 		_menuDirectlyToLoad = true;
 		_screen->setMouseCursor(1, 1, _shapes[4]);
 		buttonMenuCallback(0);


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