(PS3/XDK) Get rid of redundant apply_fbo_state_changes function

This commit is contained in:
twinaphex 2012-11-19 00:01:25 +01:00
parent b1ea2dcc1e
commit 3bdfb3a011
9 changed files with 20 additions and 43 deletions

View File

@ -20,8 +20,7 @@
#define context_destroy_func() gfx_ctx_destroy()
#ifdef HAVE_FBO
#define context_set_fbo_func(enable) gl->ctx_driver->set_fbo(enable)
#define context_apply_fbo_state_changes_func(var) gl->ctx_driver->apply_fbo_state_changes(var)
#define context_set_fbo_func(var) gl->ctx_driver->set_fbo(var)
#endif
#define context_get_available_resolutions_func() gl->ctx_driver->get_available_resolutions()

View File

@ -187,14 +187,9 @@ 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)
static void rmenu_ctx_ps3_set_fbo_enable(unsigned i)
{
gfx_ctx_set_fbo(enable);
}
static void rmenu_ctx_ps3_apply_fbo_state_changes(unsigned i)
{
gfx_ctx_apply_fbo_state_changes(i);
gfx_ctx_set_fbo(i);
}
const rmenu_context_t rmenu_ctx_ps3 = {
@ -203,7 +198,6 @@ const rmenu_context_t rmenu_ctx_ps3 = {
.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,

View File

@ -220,15 +220,11 @@ static void rmenu_ctx_xdk_set_aspect_ratio(unsigned aspectratio_index)
driver.video->set_aspect_ratio(NULL, aspectratio_index);
}
static void rmenu_ctx_xdk_set_fbo_enable(bool enable)
static void rmenu_ctx_xdk_set_fbo_enable(unsigned i)
{
gfx_ctx_xdk_set_fbo(enable);
gfx_ctx_xdk_set_fbo(i);
}
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 = {
rmenu_ctx_xdk_clear,
@ -236,7 +232,6 @@ 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,

View File

@ -685,11 +685,11 @@ static void select_file(menu *current_menu, uint64_t input)
break;
case PRESET_CHOICE:
strlcpy(g_extern.file_state.cgp_path, path, sizeof(g_extern.file_state.cgp_path));
context->apply_fbo_state_changes(FBO_DEINIT);
context->set_fbo_enable(FBO_DEINIT);
#ifdef HAVE_OPENGL
gl_cg_reinit(path);
#endif
context->apply_fbo_state_changes(FBO_INIT);
context->set_fbo_enable(FBO_INIT);
break;
#endif
case INPUT_PRESET_CHOICE:
@ -1058,13 +1058,16 @@ 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_SCALE_ENABLED);
context->set_fbo_enable(g_settings.video.render_to_texture);
if(g_settings.video.render_to_texture)
context->set_fbo_enable(FBO_INIT);
else
context->set_fbo_enable(FBO_DEINIT);
}
if(input & (1 << RMENU_DEVICE_NAV_START))
{
rarch_settings_default(S_DEF_SCALE_ENABLED);
context->apply_fbo_state_changes(FBO_DEINIT);
context->apply_fbo_state_changes(FBO_INIT);
context->set_fbo_enable(FBO_REINIT);
}
break;
case SETTING_SCALE_FACTOR:
@ -1077,7 +1080,7 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_
if(should_decrement)
{
rarch_settings_change(S_SCALE_FACTOR_DECREMENT);
context->apply_fbo_state_changes(FBO_REINIT);
context->set_fbo_enable(FBO_REINIT);
}
}
}
@ -1089,15 +1092,14 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_
if(should_increment)
{
rarch_settings_change(S_SCALE_FACTOR_INCREMENT);
context->apply_fbo_state_changes(FBO_REINIT);
context->set_fbo_enable(FBO_REINIT);
}
}
}
if(input & (1 << RMENU_DEVICE_NAV_START))
{
rarch_settings_default(S_DEF_SCALE_FACTOR);
context->apply_fbo_state_changes(FBO_DEINIT);
context->apply_fbo_state_changes(FBO_INIT);
context->set_fbo_enable(FBO_REINIT);
}
break;
#endif

View File

@ -75,8 +75,7 @@ typedef struct rmenu_context
void (*set_filtering)(unsigned index, bool set_smooth);
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 (*set_fbo_enable)(unsigned i);
void (*free_textures)(void);
void (*init_textures)(void);
void (*render_selection_panel)(rmenu_position_t *position);

View File

@ -361,11 +361,7 @@ static void gfx_ctx_set_filtering(unsigned index, bool set_smooth)
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
}
static void gfx_ctx_set_fbo(bool enable)
{
}
static void gfx_ctx_apply_fbo_state_changes(unsigned mode)
static void gfx_ctx_set_fbo(unsigned mode)
{
gl_t *gl = driver.video_data;
@ -438,7 +434,6 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
#endif
gfx_ctx_set_fbo,
gfx_ctx_apply_fbo_state_changes,
#ifdef HAVE_RMENU
gfx_ctx_rmenu_frame
#endif

View File

@ -464,10 +464,6 @@ static void gfx_ctx_xdk_set_fbo(bool enable)
#endif
}
void gfx_ctx_xdk_apply_fbo_state_changes(unsigned mode)
{
}
void gfx_ctx_xdk_screenshot_dump(void *data)
{
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
@ -562,5 +558,4 @@ const gfx_ctx_driver_t gfx_ctx_xdk = {
gfx_ctx_xdk_menu_init,
gfx_ctx_xdk_set_fbo,
gfx_ctx_xdk_apply_fbo_state_changes,
};

View File

@ -97,8 +97,7 @@ typedef struct gfx_ctx_driver
void (*get_available_resolutions)(void);
int (*check_resolution)(unsigned resolution_id);
bool (*rmenu_init)(void);
void (*set_fbo)(bool);
void (*apply_fbo_state_changes)(unsigned);
void (*set_fbo)(unsigned);
#endif
#ifdef HAVE_RMENU
void (*rmenu_frame)(void *data);

View File

@ -61,8 +61,7 @@
#define context_get_video_size_func(win, height) gl->ctx_driver->get_video_size(win, height)
#define context_update_window_title_func(var) gl->ctx_driver->update_window_title(var)
#define context_destroy_func() gl->ctx_driver->destroy()
#define context_set_fbo_func(enable) gl->ctx_driver->set_fbo(enable)
#define context_apply_fbo_state_changes_func(var) gl->ctx_driver->apply_fbo_state_changes(var)
#define context_set_fbo_func(var) gl->ctx_driver->set_fbo(var)
#define context_get_available_resolutions_func() gl->ctx_driver->get_available_resolutions()
#define context_translate_aspect_func(width, height) gl->ctx_driver->translate_aspect(width, height)
#define context_set_resize_func(width, height) gl->ctx_driver->set_resize(width, height)