mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-29 05:54:17 +01:00
cleanup screenshot memory management.
This commit is contained in:
parent
19f8899759
commit
fac58f9986
@ -1527,8 +1527,7 @@ static int MenuGame()
|
|||||||
delete gameScreenImg;
|
delete gameScreenImg;
|
||||||
delete gameScreen;
|
delete gameScreen;
|
||||||
gameScreen = NULL;
|
gameScreen = NULL;
|
||||||
free(gameScreenPng);
|
ClearScreenshot();
|
||||||
gameScreenPng = NULL;
|
|
||||||
if(GCSettings.AutoloadGame) {
|
if(GCSettings.AutoloadGame) {
|
||||||
ExitApp();
|
ExitApp();
|
||||||
}
|
}
|
||||||
@ -4890,11 +4889,7 @@ MainMenu (int menu)
|
|||||||
if(gameScreen)
|
if(gameScreen)
|
||||||
delete gameScreen;
|
delete gameScreen;
|
||||||
|
|
||||||
if(gameScreenPng)
|
ClearScreenshot();
|
||||||
{
|
|
||||||
free(gameScreenPng);
|
|
||||||
gameScreenPng = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// wait for keys to be depressed
|
// wait for keys to be depressed
|
||||||
while(MenuRequested())
|
while(MenuRequested())
|
||||||
|
@ -389,7 +389,6 @@ int main(int argc, char *argv[])
|
|||||||
savebuffer = (unsigned char *)malloc(SAVEBUFFERSIZE);
|
savebuffer = (unsigned char *)malloc(SAVEBUFFERSIZE);
|
||||||
browserList = (BROWSERENTRY *)malloc(sizeof(BROWSERENTRY)*MAX_BROWSER_SIZE);
|
browserList = (BROWSERENTRY *)malloc(sizeof(BROWSERENTRY)*MAX_BROWSER_SIZE);
|
||||||
#endif
|
#endif
|
||||||
gameScreenPng = (u8 *)malloc(512*1024);
|
|
||||||
InitGUIThreads();
|
InitGUIThreads();
|
||||||
|
|
||||||
bool autoboot = false;
|
bool autoboot = false;
|
||||||
|
@ -757,6 +757,16 @@ void TakeScreenshot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClearScreenshot()
|
||||||
|
{
|
||||||
|
if(gameScreenPng)
|
||||||
|
{
|
||||||
|
gameScreenPngSize = 0;
|
||||||
|
free(gameScreenPng);
|
||||||
|
gameScreenPng = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* ResetVideo_Menu
|
* ResetVideo_Menu
|
||||||
*
|
*
|
||||||
|
@ -21,6 +21,7 @@ void StopGX();
|
|||||||
void ResetVideo_Emu();
|
void ResetVideo_Emu();
|
||||||
void ResetVideo_Menu();
|
void ResetVideo_Menu();
|
||||||
void TakeScreenshot();
|
void TakeScreenshot();
|
||||||
|
void ClearScreenshot();
|
||||||
void Menu_Render();
|
void Menu_Render();
|
||||||
void Menu_DrawImg(f32 xpos, f32 ypos, u16 width, u16 height, u8 data[], f32 degrees, f32 scaleX, f32 scaleY, u8 alphaF );
|
void Menu_DrawImg(f32 xpos, f32 ypos, u16 width, u16 height, u8 data[], f32 degrees, f32 scaleX, f32 scaleY, u8 alphaF );
|
||||||
void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled);
|
void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled);
|
||||||
|
Loading…
Reference in New Issue
Block a user