Skip to content

Commit

Permalink
WAGE: Optimize menu redraws
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 11, 2016
1 parent d485f7d commit 644f1ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engines/wage/gui.cpp
Expand Up @@ -596,8 +596,12 @@ void Gui::mouseMove(int x, int y) {

Designed *Gui::getClickTarget(int x, int y) {
if (_menu->_menuActivated) {
if (_menu->mouseRelease(x, y))
if (_menu->mouseRelease(x, y)) {
_sceneDirty = true;
_consoleDirty = true;
_bordersDirty = true;
_menuDirty = true;
}

return NULL;
}
Expand Down
3 changes: 3 additions & 0 deletions engines/wage/menu.cpp
Expand Up @@ -211,6 +211,9 @@ bool Menu::mouseClick(int x, int y) {
if (_bbox.contains(x, y)) {
for (int i = 0; i < _items.size(); i++)
if (_items[i]->bbox.contains(x, y)) {
if (_activeItem == i)
return false;

_activeItem = i;
_activeSubItem = -1;
_menuActivated = true;
Expand Down

0 comments on commit 644f1ef

Please sign in to comment.