mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(PS3) Some more refactorings to do with RMenu context files
This commit is contained in:
parent
7ab348dc40
commit
594aaa4600
@ -187,11 +187,23 @@ static void rmenu_ctx_ps3_set_aspect_ratio(unsigned aspectratio_index)
|
||||
driver.video->set_aspect_ratio(NULL, aspectratio_index);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_set_fbo_enable(bool enable)
|
||||
{
|
||||
gfx_ctx_set_fbo(enable);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_apply_fbo_state_changes(unsigned i)
|
||||
{
|
||||
gfx_ctx_apply_fbo_state_changes(i);
|
||||
}
|
||||
|
||||
const rmenu_context_t rmenu_ctx_ps3 = {
|
||||
.clear = rmenu_ctx_ps3_clear,
|
||||
.set_filtering = rmenu_ctx_ps3_set_filtering,
|
||||
.set_aspect_ratio = rmenu_ctx_ps3_set_aspect_ratio,
|
||||
.blend = rmenu_ctx_ps3_blend,
|
||||
.set_fbo_enable = rmenu_ctx_ps3_set_fbo_enable,
|
||||
.apply_fbo_state_changes = rmenu_ctx_ps3_apply_fbo_state_changes,
|
||||
.free_textures = rmenu_ctx_ps3_free_textures,
|
||||
.init_textures = rmenu_ctx_ps3_init_textures,
|
||||
.render_selection_panel = rmenu_ctx_ps3_render_selection_panel,
|
||||
|
@ -226,7 +226,12 @@ static void rmenu_ctx_xdk_set_aspect_ratio(unsigned aspectratio_index)
|
||||
|
||||
static void rmenu_ctx_xdk_set_fbo_enable(bool enable)
|
||||
{
|
||||
gfx_ctx_xdk_set_fbo(enable);
|
||||
gfx_ctx_xdk_set_fbo(enable);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_apply_fbo_state_changes(unsigned i)
|
||||
{
|
||||
gfx_ctx_xdk_apply_fbo_state_changes(i);
|
||||
}
|
||||
|
||||
const rmenu_context_t rmenu_ctx_xdk = {
|
||||
@ -235,6 +240,7 @@ const rmenu_context_t rmenu_ctx_xdk = {
|
||||
rmenu_ctx_xdk_set_aspect_ratio,
|
||||
rmenu_ctx_xdk_blend,
|
||||
rmenu_ctx_xdk_set_fbo_enable,
|
||||
rmenu_ctx_xdk_apply_fbo_state_changes,
|
||||
rmenu_ctx_xdk_free_textures,
|
||||
rmenu_ctx_xdk_init_textures,
|
||||
rmenu_ctx_xdk_render_selection_panel,
|
||||
|
@ -691,11 +691,11 @@ static void select_file(menu *current_menu, uint64_t input)
|
||||
break;
|
||||
case PRESET_CHOICE:
|
||||
strlcpy(g_console.cgp_path, path, sizeof(g_console.cgp_path));
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_DEINIT);
|
||||
context->apply_fbo_state_changes(FBO_DEINIT);
|
||||
#ifdef HAVE_OPENGL
|
||||
gl_cg_reinit(path);
|
||||
#endif
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_INIT);
|
||||
context->apply_fbo_state_changes(FBO_INIT);
|
||||
break;
|
||||
#endif
|
||||
case INPUT_PRESET_CHOICE:
|
||||
@ -1052,25 +1052,25 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_
|
||||
if((input & (1 << RMENU_DEVICE_NAV_LEFT)) || (input & (1 << RMENU_DEVICE_NAV_RIGHT)) || (input & (1 << RMENU_DEVICE_NAV_B)))
|
||||
{
|
||||
rarch_settings_change(S_HW_TEXTURE_FILTER_2);
|
||||
gfx_ctx_set_filtering(2, g_settings.video.second_pass_smooth);
|
||||
context->set_filtering(2, g_settings.video.second_pass_smooth);
|
||||
}
|
||||
if(input & (1 << RMENU_DEVICE_NAV_START))
|
||||
{
|
||||
rarch_settings_change(S_DEF_HW_TEXTURE_FILTER_2);
|
||||
gfx_ctx_set_filtering(2, g_settings.video.second_pass_smooth);
|
||||
context->set_filtering(2, g_settings.video.second_pass_smooth);
|
||||
}
|
||||
break;
|
||||
case SETTING_SCALE_ENABLED:
|
||||
if((input & (1 << RMENU_DEVICE_NAV_LEFT)) || (input & (1 << RMENU_DEVICE_NAV_RIGHT)) || (input & (1 << RMENU_DEVICE_NAV_B)))
|
||||
{
|
||||
rarch_settings_change(S_SCALE_ENABLED);
|
||||
gfx_ctx_set_fbo(g_console.fbo_enabled);
|
||||
context->set_fbo_enable(g_console.fbo_enabled);
|
||||
}
|
||||
if(input & (1 << RMENU_DEVICE_NAV_START))
|
||||
{
|
||||
rarch_settings_default(S_DEF_SCALE_ENABLED);
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_DEINIT);
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_INIT);
|
||||
context->apply_fbo_state_changes(FBO_DEINIT);
|
||||
context->apply_fbo_state_changes(FBO_INIT);
|
||||
}
|
||||
break;
|
||||
case SETTING_SCALE_FACTOR:
|
||||
@ -1083,7 +1083,7 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_
|
||||
if(should_decrement)
|
||||
{
|
||||
rarch_settings_change(S_SCALE_FACTOR_DECREMENT);
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_REINIT);
|
||||
context->apply_fbo_state_changes(FBO_REINIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1095,15 +1095,15 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_
|
||||
if(should_increment)
|
||||
{
|
||||
rarch_settings_change(S_SCALE_FACTOR_INCREMENT);
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_REINIT);
|
||||
context->apply_fbo_state_changes(FBO_REINIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(input & (1 << RMENU_DEVICE_NAV_START))
|
||||
{
|
||||
rarch_settings_default(S_DEF_SCALE_FACTOR);
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_DEINIT);
|
||||
gfx_ctx_apply_fbo_state_changes(FBO_INIT);
|
||||
context->apply_fbo_state_changes(FBO_DEINIT);
|
||||
context->apply_fbo_state_changes(FBO_INIT);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -76,6 +76,7 @@ typedef struct rmenu_context
|
||||
void (*set_aspect_ratio)(unsigned aspectratio_index);
|
||||
void (*blend)(bool enable);
|
||||
void (*set_fbo_enable)(bool enable);
|
||||
void (*apply_fbo_state_changes)(unsigned i);
|
||||
void (*free_textures)(void);
|
||||
void (*init_textures)(void);
|
||||
void (*render_selection_panel)(rmenu_position_t *position);
|
||||
|
Loading…
Reference in New Issue
Block a user