(RARCH_CONSOLE) Use local variable copy of g_extern.lifecycle_menu_state in frame

functions - more state functionality will be moved here (for console ports)
This commit is contained in:
twinaphex 2013-01-11 06:32:35 +01:00
parent 936e7b2709
commit 5bf022fd99
3 changed files with 12 additions and 7 deletions

View File

@ -1192,6 +1192,9 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
RARCH_PERFORMANCE_START(frame_run); RARCH_PERFORMANCE_START(frame_run);
gl_t *gl = (gl_t*)data; gl_t *gl = (gl_t*)data;
#ifdef HAVE_RMENU
unsigned lifecycle_menu_state = g_extern.lifecycle_menu_state;
#endif
gl_shader_use_func(gl, 1); gl_shader_use_func(gl, 1);
@ -1285,7 +1288,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
RARCH_PERFORMANCE_STOP(frame_run); RARCH_PERFORMANCE_STOP(frame_run);
#ifdef HAVE_RMENU #ifdef HAVE_RMENU
if (g_extern.lifecycle_menu_state & (1 << MODE_MENU_DRAW)) if (lifecycle_menu_state & (1 << MODE_MENU_DRAW))
context_rmenu_frame_func(gl); context_rmenu_frame_func(gl);
else else
#endif #endif

View File

@ -868,6 +868,7 @@ static bool gx_frame(void *data, const void *frame,
gx_video_t *gx = (gx_video_t*)driver.video_data; gx_video_t *gx = (gx_video_t*)driver.video_data;
bool should_resize = gx->should_resize; bool should_resize = gx->should_resize;
u8 clear_efb = GX_FALSE; u8 clear_efb = GX_FALSE;
u32 lifecycle_menu_state = g_extern.lifecycle_menu_state;
(void)data; (void)data;
@ -876,7 +877,7 @@ static bool gx_frame(void *data, const void *frame,
else else
gx->msg[0] = 0; gx->msg[0] = 0;
if(!frame && !(g_extern.lifecycle_menu_state & (1 << MODE_MENU_DRAW))) if(!frame && !(lifecycle_menu_state & (1 << MODE_MENU_DRAW)))
return true; return true;
if (!frame) if (!frame)
@ -888,7 +889,7 @@ static bool gx_frame(void *data, const void *frame,
clear_efb = GX_TRUE; clear_efb = GX_TRUE;
} }
while ((g_vsync || (g_extern.lifecycle_menu_state & (1 << MODE_MENU_DRAW))) && !g_draw_done) while ((g_vsync || (lifecycle_menu_state & (1 << MODE_MENU_DRAW))) && !g_draw_done)
LWP_ThreadSleep(g_video_cond); LWP_ThreadSleep(g_video_cond);
if (width != gx_old_width || height != gx_old_height) if (width != gx_old_width || height != gx_old_height)
@ -905,14 +906,14 @@ static bool gx_frame(void *data, const void *frame,
{ {
if (gx->rgb32) if (gx->rgb32)
convert_texture32(frame, g_tex.data, width, height, pitch); convert_texture32(frame, g_tex.data, width, height, pitch);
else if (g_extern.lifecycle_menu_state & (1 << MODE_MENU_DRAW)) else if (lifecycle_menu_state & (1 << MODE_MENU_DRAW))
convert_texture16_conv(frame, g_tex.data, width, height, pitch); convert_texture16_conv(frame, g_tex.data, width, height, pitch);
else else
convert_texture16(frame, g_tex.data, width, height, pitch); convert_texture16(frame, g_tex.data, width, height, pitch);
DCFlushRange(g_tex.data, height * (width << (gx->rgb32 ? 2 : 1))); DCFlushRange(g_tex.data, height * (width << (gx->rgb32 ? 2 : 1)));
} }
if (g_extern.lifecycle_menu_state & (1 << MODE_MENU_DRAW)) if (lifecycle_menu_state & (1 << MODE_MENU_DRAW))
{ {
convert_texture16(gx->menu_data, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, RGUI_WIDTH * 2); convert_texture16(gx->menu_data, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, RGUI_WIDTH * 2);
DCFlushRange(menu_tex.data, RGUI_WIDTH * RGUI_HEIGHT * 2); DCFlushRange(menu_tex.data, RGUI_WIDTH * RGUI_HEIGHT * 2);
@ -927,7 +928,7 @@ static bool gx_frame(void *data, const void *frame,
GX_DrawDone(); GX_DrawDone();
} }
if(g_extern.lifecycle_menu_state & (1 << MODE_MENU_DRAW)) if(lifecycle_menu_state & (1 << MODE_MENU_DRAW))
{ {
GX_LoadTexObj(&menu_tex.obj, GX_TEXMAP0); GX_LoadTexObj(&menu_tex.obj, GX_TEXMAP0);
GX_CallDispList(display_list, display_list_size); GX_CallDispList(display_list, display_list_size);

View File

@ -693,6 +693,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
{ {
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data; xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->d3d_render_device; LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->d3d_render_device;
unsigned lifecycle_menu_state = g_extern.lifecycle_menu_state;
#ifdef HAVE_FBO #ifdef HAVE_FBO
D3DSurface* pRenderTarget0; D3DSurface* pRenderTarget0;
#endif #endif
@ -892,7 +893,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
if (msg) if (msg)
d3d->font_ctx->render_msg_place(d3d, msg_width, msg_height, 0.0f, 0, msg); d3d->font_ctx->render_msg_place(d3d, msg_width, msg_height, 0.0f, 0, msg);
if (g_extern.lifecycle_menu_state & (1 << MODE_MENU_DRAW)) if (lifecycle_menu_state & (1 << MODE_MENU_DRAW))
{ {
#ifdef _XBOX360 #ifdef _XBOX360
app.Render(); app.Render();