[Scummvm-cvs-logs] SF.net SVN: scummvm: [28015] scummvm/trunk/engines/agi

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Tue Jul 10 20:32:25 CEST 2007


Revision: 28015
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28015&view=rev
Author:   buddha_
Date:     2007-07-10 11:32:24 -0700 (Tue, 10 Jul 2007)

Log Message:
-----------
Add Amiga-style menus (FR #657645). Used in Amiga-rendering mode.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/graphics.cpp
    scummvm/trunk/engines/agi/graphics.h
    scummvm/trunk/engines/agi/saveload.cpp
    scummvm/trunk/engines/agi/text.cpp

Modified: scummvm/trunk/engines/agi/graphics.cpp
===================================================================
--- scummvm/trunk/engines/agi/graphics.cpp	2007-07-10 18:08:35 UTC (rev 28014)
+++ scummvm/trunk/engines/agi/graphics.cpp	2007-07-10 18:32:24 UTC (rev 28015)
@@ -571,6 +571,24 @@
 	rawDrawButton(x, y, s, color.fg, color.bg, border, textOffset);
 }
 
+/**
+ * Draw a button using the currently chosen style.
+ * Amiga-style is used for the Amiga-rendering mode, PC-style is used otherwise.
+ * @param x  x coordinate of the button
+ * @param y  y coordinate of the button
+ * @param hasFocus  set if the button has focus
+ * @param pressed  set if the button is pressed
+ * @param positive  set if button is positive, otherwise button is negative (Only matters with Amiga-style buttons)
+ * TODO: Make Amiga-style buttons a bit wider as they were in Amiga AGI games.
+ */
+void GfxMgr::drawCurrentStyleButton(int x, int y, const char *label, bool hasFocus, bool pressed, bool positive) {
+	int textOffset     = _vm->_buttonStyle.getTextOffset(hasFocus, pressed);
+	AgiTextColor color = _vm->_buttonStyle.getColor(hasFocus, pressed, positive);
+	bool border        = _vm->_buttonStyle.getBorder(hasFocus, pressed);
+	
+	rawDrawButton(x, y, label, color.fg, color.bg, border, textOffset);
+}
+
 void GfxMgr::rawDrawButton(int x, int y, const char *s, int fgcolor, int bgcolor, bool border, int textOffset) {
 	int len = strlen(s);
 	int x1, y1, x2, y2;

Modified: scummvm/trunk/engines/agi/graphics.h
===================================================================
--- scummvm/trunk/engines/agi/graphics.h	2007-07-10 18:08:35 UTC (rev 28014)
+++ scummvm/trunk/engines/agi/graphics.h	2007-07-10 18:32:24 UTC (rev 28015)
@@ -78,6 +78,7 @@
 	void clearConsoleScreen(int);
 	void drawBox(int, int, int, int, int, int, int);
 	void drawDefaultStyleButton(int, int, const char *, int, int, int fgcolor = 0, int bgcolor = 0);
+	void drawCurrentStyleButton(int x, int y, const char *label, bool hasFocus, bool pressed = false, bool positive = true);
 	int testButton(int, int, const char *);
 	void drawRectangle(int, int, int, int, int);
 	void saveBlock(int, int, int, int, uint8 *);

Modified: scummvm/trunk/engines/agi/saveload.cpp
===================================================================
--- scummvm/trunk/engines/agi/saveload.cpp	2007-07-10 18:08:35 UTC (rev 28014)
+++ scummvm/trunk/engines/agi/saveload.cpp	2007-07-10 18:32:24 UTC (rev 28015)
@@ -516,7 +516,7 @@
 	buttonY = (vm + 17) * CHAR_LINES;
 	
 	for (i = 0; i < 2; i++)
-		_gfx->drawDefaultStyleButton(buttonX[i], buttonY, buttonText[i], 0, 0, MSG_BOX_TEXT, MSG_BOX_COLOUR);
+		_gfx->drawCurrentStyleButton(buttonX[i], buttonY, buttonText[i], false, false, i == 0);
 
 	AllowSyntheticEvents on(this);
 	int oldFirstSlot = _firstSlot + 1;

Modified: scummvm/trunk/engines/agi/text.cpp
===================================================================
--- scummvm/trunk/engines/agi/text.cpp	2007-07-10 18:08:35 UTC (rev 28014)
+++ scummvm/trunk/engines/agi/text.cpp	2007-07-10 18:32:24 UTC (rev 28015)
@@ -364,7 +364,7 @@
 	debugC(4, kDebugLevelText, "waiting...");
 	for (;;) {
 		for (i = 0; b[i]; i++)
-			_gfx->drawDefaultStyleButton(bx[i], by[i], b[i], i == active, 0, MSG_BOX_TEXT, MSG_BOX_COLOUR);
+			_gfx->drawCurrentStyleButton(bx[i], by[i], b[i], i == active, false, i == 0);
 
 		_gfx->pollTimer();	/* msdos driver -> does nothing */
 		key = doPollKeyboard();


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