GRAPHICS: MACGUI: Draw SubMenu over copy of game screen

This commit is contained in:
Avijeet 2022-07-13 17:18:37 +05:30 committed by Eugene Sandulenko
parent 6721620826
commit 94efaeb278
2 changed files with 7 additions and 6 deletions

View File

@ -1094,7 +1094,7 @@ bool MacMenu::draw(ManagedSurface *g, bool forceRedraw) {
for (uint i = 0; i < _menustack.size(); i++) {
renderSubmenu(g, _menustack[i], (i == _menustack.size() - 1));
renderSubmenu(_menustack[i], (i == _menustack.size() - 1));
}
if (g)
@ -1106,7 +1106,7 @@ bool MacMenu::draw(ManagedSurface *g, bool forceRedraw) {
return true;
}
void MacMenu::renderSubmenu(ManagedSurface *g, MacMenuSubMenu *menu, bool recursive) {
void MacMenu::renderSubmenu(MacMenuSubMenu *menu, bool recursive) {
Common::Rect *r = &menu->bbox;
if (r->width() == 0 || r->height() == 0)
@ -1217,7 +1217,7 @@ void MacMenu::renderSubmenu(ManagedSurface *g, MacMenuSubMenu *menu, bool recurs
}
if (recursive && menu->highlight != -1 && menu->items[menu->highlight]->submenu != nullptr)
renderSubmenu(g, menu->items[menu->highlight]->submenu, false);
renderSubmenu(menu->items[menu->highlight]->submenu, false);
if (_wm->_mode & kWMModalMenuMode) {
// TODO: Instead of cropping, reposition the submenu
@ -1229,8 +1229,9 @@ void MacMenu::renderSubmenu(ManagedSurface *g, MacMenuSubMenu *menu, bool recurs
if (r->top + h >= _screen.h)
h = _screen.h - 1 - r->top;
g->transBlitFrom(_screen, _wm->_colorGreen);
g_system->copyRectToScreen(g->getBasePtr(r->left, r->top), g->pitch, r->left, r->top, w, h);
Graphics::ManagedSurface g = *_wm->_screenCopy;
g.transBlitFrom(_screen, _wm->_colorGreen);
g_system->copyRectToScreen(g.getBasePtr(r->left, r->top), g.pitch, r->left, r->top, w, h);
}
}

View File

@ -140,7 +140,7 @@ private:
int calcSubMenuWidth(MacMenuSubMenu *menu);
void calcSubMenuBounds(MacMenuSubMenu *menu, int x, int y);
void renderSubmenu(ManagedSurface *g, MacMenuSubMenu *menu, bool recursive = true);
void renderSubmenu(MacMenuSubMenu *menu, bool recursive = true);
bool keyEvent(Common::Event &event);
bool mouseClick(int x, int y);