Skip to content

Commit

Permalink
WAGE: Stub for menu drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 1, 2016
1 parent 03e3f80 commit 1332958
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
25 changes: 21 additions & 4 deletions engines/wage/gui.cpp
Expand Up @@ -63,7 +63,8 @@ enum {
kMenuHeight = 19,
kMenuPadding = 6,
kMenuItemHeight = 19,
kBorderWidth = 17
kBorderWidth = 17,
kDesktopArc = 7
};

static const byte palette[] = {
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions engines/wage/gui.h
Expand Up @@ -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;
Expand Down

0 comments on commit 1332958

Please sign in to comment.