X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fplat_sdl.c;h=247437ec6ddcf431bd47b7edd20ba5230d3476a7;hp=2aa199fb3126e12c667dd106ab46eef076a2dccc;hb=8e7632dd01235ea64d7d6e712ce5410a6c594ea4;hpb=418caf437ed1af2880b013462b603e1ca1f28fb5 diff --git a/frontend/plat_sdl.c b/frontend/plat_sdl.c index 2aa199fb..247437ec 100644 --- a/frontend/plat_sdl.c +++ b/frontend/plat_sdl.c @@ -17,7 +17,7 @@ #include "libpicofe/fonts.h" #include "libpicofe/plat_sdl.h" #include "libpicofe/gl.h" -#include "../plugins/gpulib/cspace.h" +#include "cspace.h" #include "plugin_lib.h" #include "plugin.h" #include "main.h" @@ -98,6 +98,7 @@ static void get_layer_pos(int *x, int *y, int *w, int *h) void plat_init(void) { + int shadow_size; int ret; plat_sdl_quit_cb = quit_cb; @@ -110,8 +111,12 @@ void plat_init(void) in_menu = 1; SDL_WM_SetCaption("PCSX-ReARMed " REV, NULL); - shadow_fb = malloc(640 * 512 * 2); - menubg_img = malloc(640 * 512 * 2); + shadow_size = g_menuscreen_w * g_menuscreen_h * 2; + if (shadow_size < 640 * 512 * 2) + shadow_size = 640 * 512 * 2; + + shadow_fb = malloc(shadow_size); + menubg_img = malloc(shadow_size); if (shadow_fb == NULL || menubg_img == NULL) { fprintf(stderr, "OOM\n"); exit(1);