(GX) Make Wii/Gamecube gx_video no longer depend on MODE_MENU_DRAW

This commit is contained in:
twinaphex 2013-04-11 16:09:46 +02:00
parent f4c89be017
commit a49fe27d21
4 changed files with 9 additions and 13 deletions

View File

@ -2044,7 +2044,6 @@ bool menu_iterate(void)
rgui->need_refresh = true;
}
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_DRAW);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_PREINIT);
}
@ -2168,7 +2167,6 @@ deinit:
if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
g_extern.delay_timer[0] = g_extern.frame_count + 30;
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME);
return false;

View File

@ -374,9 +374,7 @@ static void system_process_args(int argc, char *argv[])
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
rgui_iterate(rgui, RGUI_ACTION_MESSAGE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_DRAW);
rarch_render_cached_frame();
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
}

View File

@ -306,7 +306,7 @@ static void init_texture(unsigned width, unsigned height)
gx_video_t *gx = (gx_video_t*)driver.video_data;
unsigned g_filter = g_settings.video.smooth ? GX_LINEAR : GX_NEAR;
GX_InitTexObj(&g_tex.obj, g_tex.data, width, height, (gx->rgb32) ? GX_TF_RGBA8 : (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_DRAW)) ? GX_TF_RGB5A3 : GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE);
GX_InitTexObj(&g_tex.obj, g_tex.data, width, height, (gx->rgb32) ? GX_TF_RGBA8 : gx->rgui_texture_enable ? GX_TF_RGB5A3 : GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE);
GX_InitTexObjLOD(&g_tex.obj, g_filter, g_filter, 0, 0, 0, GX_TRUE, GX_FALSE, GX_ANISO_1);
GX_InitTexObj(&menu_tex.obj, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE);
GX_InitTexObjLOD(&menu_tex.obj, g_filter, g_filter, 0, 0, 0, GX_TRUE, GX_FALSE, GX_ANISO_1);
@ -882,7 +882,7 @@ static bool gx_frame(void *data, const void *frame,
(void)data;
if(!frame && !(lifecycle_mode_state & (1ULL << MODE_MENU_DRAW)))
if(!frame && !gx->rgui_texture_enable)
return true;
if (!frame)
@ -894,7 +894,7 @@ static bool gx_frame(void *data, const void *frame,
clear_efb = GX_TRUE;
}
while ((g_vsync || (lifecycle_mode_state & (1ULL << MODE_MENU_DRAW))) && !g_draw_done)
while (((g_vsync || gx->rgui_texture_enable)) && !g_draw_done)
LWP_ThreadSleep(g_video_cond);
if (width != gx_old_width || height != gx_old_height)
@ -911,14 +911,14 @@ static bool gx_frame(void *data, const void *frame,
{
if (gx->rgb32)
convert_texture32(frame, g_tex.data, width, height, pitch);
else if (lifecycle_mode_state & (1ULL << MODE_MENU_DRAW))
else if (gx->rgui_texture_enable)
convert_texture16_conv(frame, g_tex.data, width, height, pitch);
else
convert_texture16(frame, g_tex.data, width, height, pitch);
DCFlushRange(g_tex.data, height * (width << (gx->rgb32 ? 2 : 1)));
}
if (gx->menu_enable && gx->menu_data)
if (gx->rgui_texture_enable && gx->menu_data)
{
convert_texture16(gx->menu_data, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, RGUI_WIDTH * 2);
DCFlushRange(menu_tex.data, RGUI_WIDTH * RGUI_HEIGHT * 2);
@ -934,7 +934,7 @@ static bool gx_frame(void *data, const void *frame,
GX_DrawDone();
}
if(lifecycle_mode_state & (1ULL << MODE_MENU_DRAW))
if (gx->rgui_texture_enable)
{
GX_SetCurrentMtx(GX_PNMTX1);
GX_LoadTexObj(&menu_tex.obj, GX_TEXMAP0);
@ -962,7 +962,7 @@ static bool gx_frame(void *data, const void *frame,
#endif
}
if (msg && !(lifecycle_mode_state & (1ULL << MODE_MENU_DRAW)))
if (msg && !gx->rgui_texture_enable)
{
unsigned x = 7 * (gx->double_strike ? 1 : 2);
unsigned y = gx->vp.full_height - (35 * (gx->double_strike ? 1 : 2));
@ -1034,7 +1034,7 @@ static void gx_set_texture_frame(void *data, const void *frame,
static void gx_set_texture_enable(void *data, bool enable)
{
gx_video_t *gx = (gx_video_t*)data;
gx->menu_enable = enable;
gx->rgui_texture_enable = enable;
}
static void gx_apply_state_changes(void *data)

View File

@ -25,7 +25,7 @@ typedef struct gx_video
bool double_strike;
bool rgb32;
uint32_t *menu_data; // FIXME: Should be const uint16_t*.
bool menu_enable;
bool rgui_texture_enable;
rarch_viewport_t vp;
unsigned scale;
} gx_video_t;