mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-27 14:23:06 +00:00
Refactor away video_viewport_reset_custom
This commit is contained in:
parent
aad6a3a2a6
commit
cf5533ccaa
@ -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. */
|
||||
|
@ -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++)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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. */
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user