Take screenshot at each menu enter

This commit is contained in:
simon.kagstrom 2010-03-15 06:11:31 +00:00
parent 7805a9c167
commit 81f51cea98
3 changed files with 12 additions and 2 deletions

View File

@ -57,8 +57,11 @@ public:
switch (which)
{
case 0:
this->box->gi->setScreenshot(TheC64->TheDisplay->SurfaceFromC64Display());
break;
{
SDL_Surface *tmp = SDL_DisplayFormat(Gui::gui->screenshot);
this->box->gi->setScreenshot(tmp);
} break;
case 2:
case 3:
case 4:

View File

@ -79,6 +79,7 @@ Gui::Gui()
this->np = NULL;
this->focus = NULL;
this->screenshot = NULL;
this->bg_left = NULL;
this->bg_middle = NULL;
@ -155,6 +156,8 @@ Gui::~Gui()
if (VirtualKeyboard::kbd)
delete VirtualKeyboard::kbd;
SDL_FreeSurface(this->screenshot);
SDL_FreeSurface(this->bg_left);
SDL_FreeSurface(this->keyboard);
SDL_FreeSurface(this->bg_middle);
@ -483,6 +486,9 @@ void Gui::draw(SDL_Surface *where)
void Gui::activate()
{
SDL_FreeSurface(this->screenshot);
this->screenshot = TheC64->TheDisplay->SurfaceFromC64Display();
this->is_active = true;
this->cur_prefs = ThePrefs;

View File

@ -85,6 +85,7 @@ public:
bool is_active;
Menu *focus; /* Where the focus goes */
Menu *main_menu;
SDL_Surface *screenshot;
SDL_Surface *background;
SDL_Surface *main_menu_bg;