From 1332958c9a951e74f1d3d93b4827c63ba052ad8f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 1 Jan 2016 02:23:43 +0100 Subject: [PATCH] WAGE: Stub for menu drawing --- engines/wage/gui.cpp | 25 +++++++++++++++++++++---- engines/wage/gui.h | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 713a1c2b5b22..0bf176a5f28b 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -63,7 +63,8 @@ enum { kMenuHeight = 19, kMenuPadding = 6, kMenuItemHeight = 19, - kBorderWidth = 17 + kBorderWidth = 17, + kDesktopArc = 7 }; static const byte palette[] = { @@ -73,7 +74,8 @@ static const byte palette[] = { 0x00, 0xff, 0x00 // Green }; -static byte checkers[8] = { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa }; +static byte checkersPattern[8] = { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa }; +static byte fillPattern[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; static const byte macCursorArrow[] = { 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -119,7 +121,7 @@ Gui::Gui() { _screen.create(g_system->getWidth(), g_system->getHeight(), Graphics::PixelFormat::createFormatCLUT8()); Patterns p; - p.push_back(checkers); + p.push_back(checkersPattern); _scrollPos = 0; _builtInFonts = false; @@ -131,8 +133,9 @@ Gui::Gui() { _cursorIsArrow = true; CursorMan.showMouse(true); + // Draw desktop Common::Rect r(0, 0, _screen.w - 1, _screen.h - 1); - Design::drawFilledRoundRect(&_screen, r, 7, kColorBlack, p, 1); + Design::drawFilledRoundRect(&_screen, r, kDesktopArc, kColorBlack, p, 1); loadFonts(); } @@ -188,6 +191,8 @@ void Gui::draw() { paintBorder(&_screen, sceneW, kMenuHeight, _screen.w - sceneW, _scene->_design->getBounds()->height(), kWindowConsole); + renderMenu(); + // Blit to screen g_system->copyRectToScreen(_screen.getPixels(), _screen.pitch, 0, 0, _screen.w, _screen.h); } @@ -451,4 +456,16 @@ void Gui::mouseMove(int x, int y) { } } +void Gui::renderMenu() { + Common::Rect r(0, 0, _screen.w - 1, kMenuHeight - 1); + Patterns p; + p.push_back(fillPattern); + + Design::drawFilledRoundRect(&_screen, r, kDesktopArc, kColorWhite, p, 1); + r.top = 7; + Design::drawFilledRect(&_screen, r, kColorWhite, p, 1); + r.top = kMenuHeight - 1; + Design::drawFilledRect(&_screen, r, kColorBlack, p, 1); +} + } // End of namespace Wage diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 216a63c6aefb..9573f57e25b9 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -75,6 +75,7 @@ class Gui { void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); void loadFonts(); + void renderMenu(); private: Graphics::Surface _screen;