[Scummvm-cvs-logs] SF.net SVN: scummvm: [26735] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed May 2 19:12:31 CEST 2007


Revision: 26735
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26735&view=rev
Author:   thebluegr
Date:     2007-05-02 10:12:30 -0700 (Wed, 02 May 2007)

Log Message:
-----------
IHNM: Added the options dialog and quit dialog with very basic functionality (continue and exit game).

The buttons are still wrong and not all the options are implemented yet, but at least the game doesn't freeze when the user tries to open the options dialog and it's now possible to exit normally

Modified Paths:
--------------
    scummvm/trunk/engines/saga/displayinfo.h
    scummvm/trunk/engines/saga/interface.cpp

Modified: scummvm/trunk/engines/saga/displayinfo.h
===================================================================
--- scummvm/trunk/engines/saga/displayinfo.h	2007-05-02 03:18:11 UTC (rev 26734)
+++ scummvm/trunk/engines/saga/displayinfo.h	2007-05-02 17:12:30 UTC (rev 26735)
@@ -318,11 +318,19 @@
 };
 
 static PanelButton IHNM_OptionPanelButtons[] = {
-	{kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO
+	//TODO: Add the rest of the buttons
+	//TODO: Those coordinates might not be pixel perfect, check with the original interpreter
+	{kPanelButtonOption,	20,150,	200,25,	kTextQuitGame,'q',0,	0,0,0}, //quit
+	{kPanelButtonOption,	20,175,	200,25,	kTextContinuePlaying,'c',0,	0,0,0}, //continue
+	//.....
 };
 
 static PanelButton IHNM_QuitPanelButtons[] = {
-	{kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO
+	//FIXME: Show the correct quit dialog background 
+	//TODO: Those coordinates might not be pixel perfect, check with the original interpreter
+	{kPanelButtonQuit,		25,80,	80,25,	kTextQuit,'q',0, 0,0,0},
+	{kPanelButtonQuit,		155,80,	80,25,	kTextCancel,'c',0, 0,0,0},
+	{kPanelButtonQuitText, -1,5,	0,0,	kTextQuitTheGameQuestion,'-',0, 0,0,0},
 };
 
 static PanelButton IHNM_LoadPanelButtons[] = {
@@ -372,12 +380,12 @@
 
 	-1, -1,		// save file index
 	0,			// optionSaveFileVisible
-	0, 0,		// option panel offsets
+	100, 75,	// option panel offsets
 	ARRAYSIZE(IHNM_OptionPanelButtons),
 	IHNM_OptionPanelButtons,
 
-	0,0,			// quit panel offsets
-	0,0,			// quit panel width & height
+	190,180,		// quit panel offsets
+	260,115,		// quit panel width & height
 	ARRAYSIZE(IHNM_QuitPanelButtons),
 	IHNM_QuitPanelButtons,
 

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2007-05-02 03:18:11 UTC (rev 26734)
+++ scummvm/trunk/engines/saga/interface.cpp	2007-05-02 17:12:30 UTC (rev 26735)
@@ -719,7 +719,6 @@
 	Rect rect2;
 	PanelButton *panelButton;
 	Point textPoint;
-	if (_optionSaveFileSlider == NULL) return;//TODO:REMOVE
 	
 	backBuffer = _vm->_gfx->getBackBuffer();
 
@@ -737,9 +736,17 @@
 	}
 
 	if (_optionSaveRectTop.height() > 0) {
-		backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey);
+		if (_vm->getGameType() == GType_ITE) {
+			backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey);
+		} else {
+			// TODO: Draw the button graphic properly for IHNM
+		}
 	}
 
+	// FIXME: The _optionSaveFileSlider checks exist for IHNM, where 
+	// _optionSaveFileSlider is not initialized correctly yet
+	if (_optionSaveFileSlider == NULL) return; //TODO:REMOVE
+
 	drawButtonBox(backBuffer, _optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0);
 
 	if (_optionSaveRectBottom.height() > 0) {
@@ -1890,8 +1897,14 @@
 	}
 	text = _vm->getTextString(textId);
 
-	textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal);
-	textHeight = _vm->_font->getHeight(kKnownFontMedium);
+	// TODO: This looks like to be the proper font for IHNM, check for validity
+	if (_vm->getGameType() == GType_ITE) {
+		textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal);
+		textHeight = _vm->_font->getHeight(kKnownFontMedium);
+	} else {
+		textWidth = _vm->_font->getStringWidth(kKnownFontVerb, text, 0, kFontNormal);
+		textHeight = _vm->_font->getHeight(kKnownFontVerb);
+	}
 
 	point.x = panel->x + panelButton->xOffset + (panelButton->width / 2) - (textWidth / 2);
 	point.y = panel->y + panelButton->yOffset + (panelButton->height / 2) - (textHeight / 2);
@@ -1905,8 +1918,13 @@
 	panel->calcPanelButtonRect(panelButton, rect);
 	drawButtonBox(ds, rect, kButton, panelButton->state > 0);
 
-	_vm->_font->textDraw(kKnownFontMedium, ds, text, point,
-		_vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
+	// TODO: This looks like to be the proper font for IHNM, check for validity
+	if (_vm->getGameType() == GType_ITE)
+		_vm->_font->textDraw(kKnownFontMedium, ds, text, point,
+			_vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
+	else
+		_vm->_font->textDraw(kKnownFontVerb, ds, text, point,
+			_vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
 }
 
 void Interface::drawPanelButtonArrow(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) {


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