diff --git a/configuration.c b/configuration.c index dd1621d3ff..72373203a9 100644 --- a/configuration.c +++ b/configuration.c @@ -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. */ diff --git a/gfx/drivers/gx_gfx.c b/gfx/drivers/gx_gfx.c index df3fd3f749..3035d9ac96 100644 --- a/gfx/drivers/gx_gfx.c +++ b/gfx/drivers/gx_gfx.c @@ -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++) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 30ccba76c3..2c795ce149 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -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) { diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 4dd42bf0d1..050ab8752c 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -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. */ diff --git a/gfx/video_viewport.c b/gfx/video_viewport.c index 9fa7c8f669..f526d2ae8f 100644 --- a/gfx/video_viewport.c +++ b/gfx/video_viewport.c @@ -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; -} diff --git a/gfx/video_viewport.h b/gfx/video_viewport.h index 2544a30509..bf0f6a751c 100644 --- a/gfx/video_viewport.h +++ b/gfx/video_viewport.h @@ -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