[Scummvm-cvs-logs] scummvm master -> c17cd72bae7db333414ad955f09478b6c24200a0

m-kiewitz m_kiewitz at users.sourceforge.net
Thu Feb 4 13:38:54 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c17cd72bae AGI: Add Amiga system UI buttons


Commit: c17cd72bae7db333414ad955f09478b6c24200a0
    https://github.com/scummvm/scummvm/commit/c17cd72bae7db333414ad955f09478b6c24200a0
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-02-04T13:38:18+01:00

Commit Message:
AGI: Add Amiga system UI buttons

Also adjust window frames for Amiga. Amiga also uses hi-res ones.

Changed paths:
    engines/agi/graphics.cpp
    engines/agi/systemui.cpp



diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 643f057..fbcb9d1 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -528,6 +528,7 @@ void GfxMgr::drawBox(int16 x, int16 y, int16 width, int16 height, byte backgroun
 	// draw lines
 	switch (_vm->_renderMode) {
 	case Common::kRenderApple2GS:
+	case Common::kRenderAmiga:
 		// Slightly different window frame, and actually using 1-pixel width, which is "hi-res"
 		drawDisplayRect(x + 2, y - 2, width - 4, 1, lineColor);
 		drawDisplayRect(x + width - 3, y - 2, 1, height - 4, lineColor);
@@ -541,9 +542,11 @@ void GfxMgr::drawBox(int16 x, int16 y, int16 width, int16 height, byte backgroun
 		drawDisplayRect(x + 1, y - height + 2, width - 2, 1, 0);
 		drawDisplayRect(x + 1, y - 1, 1, height - 2, 0);
 		break;
+	case Common::kRenderCGA:
+	case Common::kRenderEGA:
+	case Common::kRenderVGA:
+	case Common::kRenderAtariST:
 	default:
-		// Confirmed platforms that used this type:
-		// PC, Amiga, Atari ST
 		drawDisplayRect(x + 2, y - 1, width - 4, 1, lineColor);
 		drawDisplayRect(x + width - 4, y - 2, 2, height - 4, lineColor);
 		drawDisplayRect(x + 2, y - height + 2, width - 4, 1, lineColor);
diff --git a/engines/agi/systemui.cpp b/engines/agi/systemui.cpp
index 6f0d855..2023bd2 100644
--- a/engines/agi/systemui.cpp
+++ b/engines/agi/systemui.cpp
@@ -693,9 +693,9 @@ bool SystemUI::askForVerification(const char *verifyText, const char *button1Tex
 
 		switch (_vm->_renderMode) {
 		case Common::kRenderApple2GS:
+		case Common::kRenderAmiga:
 			forcedHeight += 3;
 			break;
-		case Common::kRenderAmiga:
 		case Common::kRenderAtariST:
 			forcedHeight += 2;
 			break;
@@ -741,12 +741,19 @@ bool SystemUI::askForVerification(const char *verifyText, const char *button1Tex
 				_buttonArray[1].rect = Common::Rect(14 + _buttonArray[1].textWidth, FONT_DISPLAY_HEIGHT + 6);
 				adjustedX -= _buttonArray[1].rect.width();
 				_buttonArray[1].rect.moveTo(adjustedX, msgBoxLowerY - (8 + FONT_DISPLAY_HEIGHT + 2));
-
-				drawButtonAppleIIgs(&_buttonArray[1]);
 			}
 			break;
 
 		case Common::kRenderAmiga:
+			_buttonArray[0].rect = Common::Rect(4 + _buttonArray[0].textWidth + 4, 2 + FONT_DISPLAY_HEIGHT + 2);
+			_buttonArray[0].rect.moveTo(msgBoxX, msgBoxLowerY - _buttonArray[0].rect.height());
+
+			if (_buttonArray.size() > 1) {
+				int16 adjustedX = msgBoxX + msgBoxWidth;
+				_buttonArray[1].rect = Common::Rect(4 + _buttonArray[1].textWidth + 4, 2 + FONT_DISPLAY_HEIGHT + 2);
+				adjustedX -= _buttonArray[1].rect.width();
+				_buttonArray[1].rect.moveTo(adjustedX, msgBoxLowerY - _buttonArray[1].rect.height());
+			}
 			break;
 
 		case Common::kRenderAtariST:
@@ -955,7 +962,34 @@ void SystemUI::drawButtonAppleIIgsEdgePixels(int16 x, int16 y, byte *edgeBitmap,
 }
 
 void SystemUI::drawButtonAmiga(SystemUIButtonEntry *button) {
+	byte  foregroundColor;
+	byte  backgroundColor;
+
+	if (!button->active)
+		foregroundColor = 15;
+	else
+		foregroundColor = 0;
+
+	if (button->isDefault) {
+		if (!button->active)
+			backgroundColor = 2; // green
+		else
+			backgroundColor = 13; // orange
+	} else {
+		if (!button->active)
+			backgroundColor = 4; // red
+		else
+			backgroundColor = 11; // cyan
+	}
+
+	// draw base box for it
+	_gfx->drawDisplayRect(button->rect.left, button->rect.bottom - 1, button->rect.width(), button->rect.height(), backgroundColor, false);
 
+	// Button text
+	_gfx->drawStringOnDisplay(button->rect.left + 4, button->rect.top + 2, button->text, foregroundColor, backgroundColor);
+
+	// draw base box for it
+	_gfx->copyDisplayRectToScreen(button->rect.left, button->rect.top, button->rect.width(), button->rect.height());
 }
 
 






More information about the Scummvm-git-logs mailing list