(RMenu) More callbacks for platform-specific code

This commit is contained in:
twinaphex 2012-08-19 02:00:40 +02:00
parent 5fdb1577d8
commit 519023542a
4 changed files with 16 additions and 13 deletions

View File

@ -100,6 +100,12 @@ static void rmenu_ctx_ps3_render_msg(float xpos, float ypos, float scale, float
gl_render_msg_place(gl, xpos, ypos, scale, color, msg)
}
static void rmenu_ctx_ps3_render_menu_enable(bool enable)
{
gl_t *gl = driver.video_data;
gl->menu_render = enable;
}
const rmenu_context_t rmenu_ctx_ps3 = {
.clear = rmenu_ctx_ps3_clear,
.blend = rmenu_ctx_ps3_blend,
@ -107,6 +113,7 @@ const rmenu_context_t rmenu_ctx_ps3 = {
.init_textures = rmenu_ctx_ps3_init_textures,
.render_selection_panel = rmenu_ctx_ps3_render_selection_panel,
.render_bg = rmenu_ctx_ps3_render_bg,
.render_menu_enable = rmenu_ctx_ps3_render_menu_enable,
.render_msg = rmenu_ctx_ps3_render_msg,
.swap_buffers = rmenu_ctx_ps3_swap_buffers,
.set_default_pos = rmenu_ctx_ps3_set_default_pos,

View File

@ -135,6 +135,10 @@ static void rmenu_ctx_xdk_render_msg(float xpos, float ypos, float scale, float
xfonts_render_msg_place(d3d, xpos, ypos, scale, msg);
}
static void rmenu_ctx_xdk_render_menu_enable(bool enable)
{
}
const rmenu_context_t rmenu_ctx_xdk = {
rmenu_ctx_xdk_clear,
rmenu_ctx_xdk_blend,
@ -142,6 +146,7 @@ const rmenu_context_t rmenu_ctx_xdk = {
rmenu_ctx_xdk_init_textures,
rmenu_ctx_xdk_render_selection_panel,
rmenu_ctx_xdk_render_bg,
rmenu_ctx_xdk_render_menu_enable,
rmenu_ctx_xdk_render_msg,
rmenu_ctx_xdk_swap_buffers,
rmenu_ctx_xdk_set_default_pos,

View File

@ -727,11 +727,7 @@ static void browser_render(filebrowser_t * b, float current_x, float current_y,
context->render_selection_panel(&position);
}
#ifdef _XBOX1
context->render_msg(currentX, currentY, 0, 0, fname_tmp);
#else
context->render_msg(currentX, currentY, FONT_SIZE, i == current_index ? RED : b->current_dir.list->elems[i].attr.b ? GREEN : WHITE, fname_tmp);
#endif
}
}
@ -2013,9 +2009,7 @@ static void ingame_menu_screenshot(item *items, menu *current_menu, uint64_t inp
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_A))
{
menu_stack_decrement();
#ifdef __CELLOS_LV2__
device_ptr->menu_render = true;
#endif
context->render_menu_enable(true);
}
}
}
@ -2400,16 +2394,12 @@ void menu_loop(void)
if(current_menu->enum_id == INGAME_MENU_RESIZE && (trig_state & RETRO_DEVICE_ID_JOYPAD_Y) || current_menu->enum_id == INGAME_MENU_SCREENSHOT)
{
#ifdef __CELLOS_LV2__
device_ptr->menu_render = false;
#endif
context->render_menu_enable(false);
}
else
{
context->blend(true);
#ifdef __CELLOS_LV2__
device_ptr->menu_render = true;
#endif
context->render_menu_enable(true);
}
rarch_render_cached_frame();

View File

@ -94,6 +94,7 @@ typedef struct rmenu_context
void (*init_textures)(void);
void (*render_selection_panel)(rmenu_position_t *position);
void (*render_bg)(rmenu_position_t *position);
void (*render_menu_enable)(bool enable);
void (*render_msg)(float xpos, float ypos, float scale, float color, const char *msg, ...);
void (*swap_buffers)(void);
void (*set_default_pos)(rmenu_default_positions_t *position);