(XDK) Remove texture_image_free - will have to manually do freeing

memory management without a public function for Xbox
This commit is contained in:
twinaphex 2013-04-10 09:59:29 +02:00
parent de31ccef3e
commit a871b6da54
3 changed files with 30 additions and 21 deletions

View File

@ -232,9 +232,27 @@ static void rmenu_gfx_free(void)
{
#ifdef _XBOX1
#ifdef HAVE_MENU_PANEL
texture_image_free(menu_panel);
if (menu_panel->vertex_buf)
{
menu_panel->vertex_buf->Release();
menu_panel->vertex_buf = NULL;
}
if (menu_panel->pixels)
{
menu_panel->pixels->Release();
menu_panel->pixels = NULL;
}
#endif
texture_image_free(menu_texture);
if (menu_texture->vertex_buf)
{
menu_texture->vertex_buf->Release();
menu_texture->vertex_buf = NULL;
}
if (menu_texture->pixels)
{
menu_texture->pixels->Release();
menu_texture->pixels = NULL;
}
#else
#ifdef HAVE_MENU_PANEL
if (menu_panel)
@ -1052,7 +1070,16 @@ static int select_file(uint8_t menu_type, uint64_t input)
if (menu_texture)
{
#ifdef _XBOX
texture_image_free(menu_texture);
if (menu_texture->vertex_buf)
{
menu_texture->vertex_buf->Release();
menu_texture->vertex_buf = NULL;
}
if (menu_texture->pixels)
{
menu_texture->pixels->Release();
menu_texture->pixels = NULL;
}
#else
free(menu_texture->pixels);
menu_texture->pixels = NULL;

View File

@ -39,7 +39,6 @@ struct texture_image
};
#ifdef _XBOX1
void texture_image_free(struct texture_image *out_img);
bool texture_image_render(struct texture_image *out_img);
#endif

View File

@ -54,23 +54,6 @@ bool texture_image_load(const char *path, struct texture_image *out_img)
return true;
}
void texture_image_free(struct texture_image *out_img)
{
// free the vertex buffer
if (out_img->vertex_buf)
{
out_img->vertex_buf->Release();
out_img->vertex_buf = NULL;
}
// free the texture
if (out_img->pixels)
{
out_img->pixels->Release();
out_img->pixels = NULL;
}
}
bool texture_image_render(struct texture_image *out_img)
{
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;