WAGE: Copy screen to backbuffer when entering menu

This commit is contained in:
Eugene Sandulenko 2016-01-13 10:42:10 +01:00
parent d0b60fe4b7
commit 02e0498e36
2 changed files with 5 additions and 0 deletions

View File

@ -179,6 +179,8 @@ Menu::Menu(Gui *gui) : _gui(gui) {
_menuActivated = false;
_activeItem = -1;
_activeSubItem = -1;
_screenCopy.create(_gui->_screen.w, _gui->_screen.h, Graphics::PixelFormat::createFormatCLUT8());
}
Menu::~Menu() {
@ -286,6 +288,8 @@ void Menu::renderSubmenu(MenuItem *menu) {
bool Menu::mouseClick(int x, int y) {
if (_bbox.contains(x, y)) {
_screenCopy.copyFrom(_gui->_screen);
for (int i = 0; i < _items.size(); i++)
if (_items[i]->bbox.contains(x, y)) {
if (_activeItem == i)

View File

@ -69,6 +69,7 @@ public:
private:
Gui *_gui;
Patterns _patterns;
Graphics::Surface _screenCopy;
private:
const Graphics::Font *getMenuFont();