From c17cd72bae7db333414ad955f09478b6c24200a0 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Thu, 4 Feb 2016 13:38:18 +0100 Subject: AGI: Add Amiga system UI buttons Also adjust window frames for Amiga. Amiga also uses hi-res ones. --- engines/agi/graphics.cpp | 7 +++++-- engines/agi/systemui.cpp | 40 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index 643f0576b4..fbcb9d1b95 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 6f0d855de4..2023bd2b81 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()); } -- cgit v1.2.3