diff --git a/gfx/context/ps3_ctx.c b/gfx/context/ps3_ctx.c index 5b0831b390..b976108f9b 100644 --- a/gfx/context/ps3_ctx.c +++ b/gfx/context/ps3_ctx.c @@ -43,3 +43,21 @@ void gfx_ctx_set_swap_interval(unsigned interval, bool inited) if (!success) RARCH_WARN("Failed to set swap interval.\n"); } + +void gfx_ctx_check_window(bool *quit, + bool *resize, unsigned *width, unsigned *height, unsigned frame_count) +{ + *quit = false; + *resize = false; + gl_t *gl = driver.video_data; + +#ifdef HAVE_SYSUTILS + cellSysutilCheckCallback(); +#endif + + if(gl->quitting) + *quit = true; + + if(gl->should_resize) + *resize = true; +} diff --git a/ps3/main.c b/ps3/main.c index 2df04cd950..8c7c4cf96f 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -320,12 +320,13 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat { (void) param; (void) userdata; + gl_t *gl = driver.video_data; switch (status) { case CELL_SYSUTIL_REQUEST_EXITGAME: g_console.menu_enable = false; - g_quitting = true; + gl->quitting = true; g_console.ingame_menu_enable = false; g_console.mode_switch = MODE_EXIT; break; diff --git a/ps3/ps3_video_psgl.c b/ps3/ps3_video_psgl.c index e34d1ade2b..d206ffbf34 100644 --- a/ps3/ps3_video_psgl.c +++ b/ps3/ps3_video_psgl.c @@ -110,7 +110,6 @@ struct { CellVideoOutState g_video_state; } ps3_gl; -bool g_quitting; unsigned g_frame_count; void *g_gl; @@ -621,6 +620,20 @@ static inline void set_texture_coords(GLfloat *coords, GLfloat xamt, GLfloat yam coords[7] = yamt; } +static void check_window(gl_t *gl) +{ + bool quit, resize; + + gfx_ctx_check_window(&quit, + &resize, &gl->win_width, &gl->win_height, + gl->frame_count); + + if (quit) + gl->quitting = true; + else if (resize) + gl->should_resize = true; +} + void gl_frame_menu (void) { gl_t *gl = g_gl; @@ -1102,11 +1115,9 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo static bool gl_alive(void *data) { - (void)data; -#ifdef HAVE_SYSUTILS - cellSysutilCheckCallback(); -#endif - return !g_quitting; + gl_t *gl = (gl_t*)data; + check_window(gl); + return !gl->quitting; } static bool gl_focus(void *data) diff --git a/ps3/shared.h b/ps3/shared.h index 675329478b..d458a701e3 100644 --- a/ps3/shared.h +++ b/ps3/shared.h @@ -74,7 +74,6 @@ enum { #define MENU_ITEM_LAST MENU_ITEM_RETURN_TO_XMB+1 extern unsigned g_frame_count; -extern bool g_quitting; extern char contentInfoPath[MAX_PATH_LENGTH]; extern char usrDirPath[MAX_PATH_LENGTH];