mirror of
https://github.com/dborth/snes9xgx.git
synced 2025-01-11 10:49:08 +01:00
cleanup screenshot memory management. fixes preview image not displaying
on gamecube
This commit is contained in:
parent
f016b19cab
commit
6e1a197edd
@ -60,15 +60,9 @@ static GuiImageData * pointer[4];
|
||||
#define MEM_ALLOC(A) (u8*)mem2_malloc(A)
|
||||
#define MEM_DEALLOC(A) mem2_free(A)
|
||||
#else
|
||||
#ifdef USE_VM
|
||||
#include "vmalloc.h"
|
||||
#define MEM_ALLOC(A) (u8*)vm_malloc(A)
|
||||
#define MEM_DEALLOC(A) vm_free(A)
|
||||
#else
|
||||
#define MEM_ALLOC(A) (u8*)memalign(32, A)
|
||||
#define MEM_DEALLOC(A) free(A)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static GuiTrigger * trigA = NULL;
|
||||
static GuiTrigger * trig2 = NULL;
|
||||
@ -1562,8 +1556,7 @@ static int MenuGame()
|
||||
delete gameScreenImg;
|
||||
delete gameScreen;
|
||||
gameScreen = NULL;
|
||||
free(gameScreenPng);
|
||||
gameScreenPng = NULL;
|
||||
ClearScreenshot();
|
||||
if(GCSettings.AutoloadGame) {
|
||||
ExitApp();
|
||||
}
|
||||
@ -4400,11 +4393,7 @@ MainMenu (int menu)
|
||||
if(gameScreen)
|
||||
delete gameScreen;
|
||||
|
||||
if(gameScreenPng)
|
||||
{
|
||||
free(gameScreenPng);
|
||||
gameScreenPng = NULL;
|
||||
}
|
||||
ClearScreenshot();
|
||||
|
||||
// wait for keys to be depressed
|
||||
while(MenuRequested())
|
||||
|
@ -907,6 +907,16 @@ void TakeScreenshot()
|
||||
}
|
||||
}
|
||||
|
||||
void ClearScreenshot()
|
||||
{
|
||||
if(gameScreenPng)
|
||||
{
|
||||
gameScreenPngSize = 0;
|
||||
free(gameScreenPng);
|
||||
gameScreenPng = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* ResetVideo_Menu
|
||||
*
|
||||
|
@ -25,6 +25,7 @@ void setGFX();
|
||||
void update_video (int width, int height);
|
||||
void ResetVideo_Menu();
|
||||
void TakeScreenshot();
|
||||
void ClearScreenshot();
|
||||
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_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled);
|
||||
|
Loading…
x
Reference in New Issue
Block a user