mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
(RARCH_CONSOLE) Add apply_state_changes to video driver
This commit is contained in:
parent
ad576f18f5
commit
969a92ac17
@ -817,6 +817,12 @@ static void xdk_d3d_stop(void)
|
||||
xdk_d3d_free(data);
|
||||
}
|
||||
|
||||
static void xdk_d3d_apply_state_changes(void)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
d3d->should_resize = true;
|
||||
}
|
||||
|
||||
const video_driver_t video_xdk_d3d = {
|
||||
xdk_d3d_init,
|
||||
xdk_d3d_frame,
|
||||
@ -829,5 +835,6 @@ const video_driver_t video_xdk_d3d = {
|
||||
xdk_d3d_start,
|
||||
xdk_d3d_stop,
|
||||
xdk_d3d_restart,
|
||||
xdk_d3d_apply_state_changes,
|
||||
xdk_d3d_set_rotation,
|
||||
};
|
||||
|
@ -476,7 +476,7 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
|
||||
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
|
||||
{
|
||||
g_console.soft_display_filter_enable = !g_console.soft_display_filter_enable;
|
||||
gx->should_resize = true;
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@ -484,18 +484,14 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
|
||||
if (action == RGUI_ACTION_START)
|
||||
{
|
||||
g_console.gamma_correction = 0;
|
||||
#ifdef GEKKO
|
||||
gx->should_resize = true;
|
||||
#endif
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
{
|
||||
if(g_console.gamma_correction > 0)
|
||||
{
|
||||
g_console.gamma_correction--;
|
||||
#ifdef GEKKO
|
||||
gx->should_resize = true;
|
||||
#endif
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
}
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
@ -503,9 +499,7 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
|
||||
if(g_console.gamma_correction < MAX_GAMMA_SETTING)
|
||||
{
|
||||
g_console.gamma_correction++;
|
||||
#ifdef GEKKO
|
||||
gx->should_resize = true;
|
||||
#endif
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -539,23 +533,17 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
|
||||
if (action == RGUI_ACTION_START)
|
||||
{
|
||||
rarch_settings_default(S_DEF_OVERSCAN);
|
||||
#ifdef GEKKO
|
||||
gx->should_resize = true;
|
||||
#endif
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
{
|
||||
rarch_settings_change(S_OVERSCAN_DECREMENT);
|
||||
#ifdef GEKKO
|
||||
gx->should_resize = true;
|
||||
#endif
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
{
|
||||
rarch_settings_change(S_OVERSCAN_INCREMENT);
|
||||
#ifdef GEKKO
|
||||
gx->should_resize = true;
|
||||
#endif
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_AUDIO_MUTE:
|
||||
|
1
driver.h
1
driver.h
@ -186,6 +186,7 @@ typedef struct video_driver
|
||||
void (*start)(void);
|
||||
void (*stop)(void);
|
||||
void (*restart)(void);
|
||||
void (*apply_state_changes)(void);
|
||||
#endif
|
||||
|
||||
void (*set_rotation)(void *data, unsigned rotation);
|
||||
|
8
gfx/gl.c
8
gfx/gl.c
@ -1337,6 +1337,13 @@ static void gl_restart(void)
|
||||
SET_TIMER_EXPIRATION(gl, 30);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl_apply_state_changes(void)
|
||||
{
|
||||
gl_t *gl = (gl_t*)driver.video_data;
|
||||
gl->should_resize = true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const video_driver_t video_gl = {
|
||||
@ -1359,6 +1366,7 @@ const video_driver_t video_gl = {
|
||||
gl_start,
|
||||
gl_stop,
|
||||
gl_restart,
|
||||
gl_apply_state_changes,
|
||||
#endif
|
||||
|
||||
gl_set_rotation,
|
||||
|
@ -587,6 +587,12 @@ static void gx_set_rotation(void * data, unsigned orientation)
|
||||
gx->should_resize = true;
|
||||
}
|
||||
|
||||
static void gx_apply_state_changes(void)
|
||||
{
|
||||
gx_video_t *gx = (gx_video_t*)driver.video_data;
|
||||
gx->should_resize = true;
|
||||
}
|
||||
|
||||
const video_driver_t video_gx = {
|
||||
.init = gx_init,
|
||||
.frame = gx_frame,
|
||||
@ -599,4 +605,5 @@ const video_driver_t video_gx = {
|
||||
.start = gx_start,
|
||||
.stop = gx_stop,
|
||||
.restart = gx_restart,
|
||||
.apply_state_changes = gx_apply_state_changes,
|
||||
};
|
||||
|
@ -528,6 +528,12 @@ static void xdk_d3d_stop(void)
|
||||
xdk_d3d_free(data);
|
||||
}
|
||||
|
||||
static void xdk_d3d_apply_state_changes(void)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
d3d->should_resize = true;
|
||||
}
|
||||
|
||||
const video_driver_t video_xdk_d3d = {
|
||||
xdk_d3d_init,
|
||||
xdk_d3d_frame,
|
||||
@ -540,5 +546,6 @@ const video_driver_t video_xdk_d3d = {
|
||||
xdk_d3d_start,
|
||||
xdk_d3d_stop,
|
||||
xdk_d3d_restart,
|
||||
xdk_d3d_apply_state_changes,
|
||||
xdk_d3d_set_rotation,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user