Refactor away video_viewport_reset_custom

This commit is contained in:
twinaphex 2015-11-21 12:36:14 +01:00
parent aad6a3a2a6
commit cf5533ccaa
6 changed files with 16 additions and 16 deletions

View File

@ -640,7 +640,7 @@ static void config_set_defaults(void)
settings->core.set_supports_no_game_enable = true;
video_viewport_reset_custom();
video_driver_ctl(RARCH_DISPLAY_CTL_RESET_CUSTOM_VIEWPORT, NULL);
/* Make sure settings from other configs carry over into defaults
* for another config. */

View File

@ -430,7 +430,8 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
}
/* custom viewports for older resolutions will most likely be corrupted, reset them */
video_viewport_reset_custom();
/* TOD/FIXME - is this needed? */
video_driver_ctl(RARCH_DISPLAY_CTL_RESET_CUSTOM_VIEWPORT, NULL);
g_current_framebuf = 0;
for(i = 0; i < GX_RESOLUTIONS_LAST; i++)

View File

@ -1224,6 +1224,18 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
switch (state)
{
case RARCH_DISPLAY_CTL_RESET_CUSTOM_VIEWPORT:
{
struct video_viewport *custom_vp = video_viewport_get_custom();
if (!custom_vp)
return false;
custom_vp->width = 0;
custom_vp->height = 0;
custom_vp->x = 0;
custom_vp->y = 0;
}
return true;
case RARCH_DISPLAY_CTL_GET_NEXT_VIDEO_OUT:
if (poke && poke->get_video_output_next)
{

View File

@ -237,6 +237,7 @@ enum rarch_display_ctl_state
RARCH_DISPLAY_CTL_HAS_WINDOWED,
RARCH_DISPLAY_CTL_IS_FOCUSED,
RARCH_DISPLAY_CTL_SET_ASPECT_RATIO,
RARCH_DISPLAY_CTL_RESET_CUSTOM_VIEWPORT,
RARCH_DISPLAY_CTL_READ_VIEWPORT,
RARCH_DISPLAY_CTL_SET_NONBLOCK_STATE,
/* Renders the current video frame. */

View File

@ -234,15 +234,3 @@ struct video_viewport *video_viewport_get_custom(void)
settings_t *settings = config_get_ptr();
return &settings->video_viewport_custom;
}
void video_viewport_reset_custom(void)
{
struct video_viewport *custom_vp = video_viewport_get_custom();
if (!custom_vp)
return;
custom_vp->width = 0;
custom_vp->height = 0;
custom_vp->x = 0;
custom_vp->y = 0;
}

View File

@ -140,8 +140,6 @@ void video_viewport_get_scaled_integer(struct video_viewport *vp,
struct retro_system_av_info *video_viewport_get_system_av_info(void);
void video_viewport_reset_custom(void);
struct video_viewport *video_viewport_get_custom(void);
#ifdef __cplusplus