Skip to content

Commit

Permalink
WAGE: Fix submenu rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Feb 14, 2016
1 parent 40eb91d commit ee89992
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion engines/wage/gui.cpp
Expand Up @@ -68,8 +68,9 @@ static const byte palette[] = {
};

static byte fillPattern[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static byte fillPatternStripes[8] = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa };
static byte fillPatternStripes[8] = { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 };
static byte fillPatternCheckers[8] = { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 };
static byte fillPatternCheckers2[8] = { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa };

static const byte macCursorArrow[] = {
2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
Expand Down Expand Up @@ -163,6 +164,7 @@ Gui::Gui(WageEngine *engine) {
_patterns.push_back(fillPattern);
_patterns.push_back(fillPatternStripes);
_patterns.push_back(fillPatternCheckers);
_patterns.push_back(fillPatternCheckers2);

loadFonts();

Expand Down
3 changes: 2 additions & 1 deletion engines/wage/gui.h
Expand Up @@ -80,7 +80,8 @@ enum {
enum {
kPatternSolid = 1,
kPatternStripes = 2,
kPatternCheckers = 3
kPatternCheckers = 3,
kPatternCheckers2 = 4
};

class Gui {
Expand Down
8 changes: 4 additions & 4 deletions engines/wage/menu.cpp
Expand Up @@ -107,9 +107,9 @@ struct MenuData {
{ 1, "New", kMenuActionNew, 0, false },
{ 1, "Open...", kMenuActionOpen, 0, false },
{ 1, "Close", kMenuActionClose, 0, true },
{ 1, "Save", kMenuActionSave, 0, true },
{ 1, "Save", kMenuActionSave, 0, false },
{ 1, "Save as...", kMenuActionSaveAs, 0, true },
{ 1, "Revert", kMenuActionRevert, 0, true },
{ 1, "Revert", kMenuActionRevert, 0, false },
{ 1, "Quit", kMenuActionQuit, 0, true },

{ 2, "Undo", kMenuActionUndo, 'Z', false },
Expand Down Expand Up @@ -428,7 +428,7 @@ void Menu::renderSubmenu(MenuItem *menu) {
for (int ii = 0; ii < _tempSurface.h; ii++) {
const byte *src = (const byte *)_tempSurface.getBasePtr(0, ii);
byte *dst = (byte *)_gui->_screen.getBasePtr(x, y+ii);
byte pat = _gui->_patterns[kPatternCheckers - 1][ii % 8];
byte pat = _gui->_patterns[kPatternCheckers2 - 1][ii % 8];
for (int j = 0; j < r->width(); j++) {
if (*src != kColorGreen && (pat & (1 << (7 - (x + j) % 8))))
*dst = *src;
Expand All @@ -438,7 +438,7 @@ void Menu::renderSubmenu(MenuItem *menu) {
}
}
} else { // Delimiter
Design::drawHLine(&_gui->_screen, r->left, r->right, y + kMenuDropdownItemHeight / 2, 1, kColorBlack, _gui->_patterns, kPatternStripes);
Design::drawHLine(&_gui->_screen, r->left + 1, r->right - 1, y + kMenuDropdownItemHeight / 2, 1, kColorBlack, _gui->_patterns, kPatternStripes);
}

y += kMenuDropdownItemHeight;
Expand Down

0 comments on commit ee89992

Please sign in to comment.