Skip to content

Commit 8204200

Browse files
committed
Combine fast-forward widget as frame throttle widget
1 parent 4c3793f commit 8204200

4 files changed

Lines changed: 45 additions & 29 deletions

File tree

gfx/gfx_widgets.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,9 +1559,9 @@ void gfx_widgets_frame(void *data)
15591559
unsigned video_width = video_info->width;
15601560
unsigned video_height = video_info->height;
15611561
bool widgets_is_paused = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_PAUSED) ? true : false;
1562-
bool widgets_is_fastforwarding = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_FAST_FORWARD) ? true : false;
1562+
bool widgets_is_fastmotion = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_FASTMOTION) ? true : false;
1563+
bool widgets_is_slowmotion = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_SLOWMOTION) ? true : false;
15631564
bool widgets_is_rewinding = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_REWINDING) ? true : false;
1564-
bool runloop_is_slowmotion = video_info->runloop_is_slowmotion;
15651565
#ifdef HAVE_MENU
15661566
bool menu_screensaver_active = (video_info->menu_st_flags & MENU_ST_FLAG_SCREENSAVER_ACTIVE) ? true : false;
15671567
#endif
@@ -1764,7 +1764,7 @@ void gfx_widgets_frame(void *data)
17641764
top_right_x_advance,
17651765
MSG_PAUSED);
17661766

1767-
if (widgets_is_fastforwarding)
1767+
if (widgets_is_fastmotion)
17681768
top_right_x_advance -= gfx_widgets_draw_indicator(
17691769
p_dispwidget,
17701770
p_disp,
@@ -1792,7 +1792,7 @@ void gfx_widgets_frame(void *data)
17921792
top_right_x_advance,
17931793
MSG_REWINDING);
17941794

1795-
if (runloop_is_slowmotion)
1795+
if (widgets_is_slowmotion)
17961796
{
17971797
top_right_x_advance -= gfx_widgets_draw_indicator(
17981798
p_dispwidget,

gfx/video_driver.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,34 +138,35 @@ enum video_driver_state_flags
138138
VIDEO_FLAG_DEFERRED_VIDEO_CTX_DRIVER_SET_FLAGS = (1 << 0 ),
139139
VIDEO_FLAG_WINDOW_TITLE_UPDATE = (1 << 1 ),
140140
VIDEO_FLAG_WIDGETS_PAUSED = (1 << 2 ),
141-
VIDEO_FLAG_WIDGETS_FAST_FORWARD = (1 << 3 ),
142-
VIDEO_FLAG_WIDGETS_REWINDING = (1 << 4 ),
143-
VIDEO_FLAG_STARTED_FULLSCREEN = (1 << 5 ),
141+
VIDEO_FLAG_WIDGETS_FASTMOTION = (1 << 3 ),
142+
VIDEO_FLAG_WIDGETS_SLOWMOTION = (1 << 4 ),
143+
VIDEO_FLAG_WIDGETS_REWINDING = (1 << 5 ),
144+
VIDEO_FLAG_STARTED_FULLSCREEN = (1 << 6 ),
144145
/* Graphics driver requires RGBA byte order data (ABGR on little-endian)
145146
* for 32-bit.
146147
* This takes effect for overlay and shader cores that wants to load
147148
* data into graphics driver. Kinda hackish to place it here, it is only
148149
* used for GLES.
149150
* TODO: Refactor this better. */
150-
VIDEO_FLAG_USE_RGBA = (1 << 6 ),
151+
VIDEO_FLAG_USE_RGBA = (1 << 7 ),
151152
/* Graphics driver supports HDR displays
152153
* Currently only D3D11/D3D12/Vulkan supports HDR displays
153154
* on Windows and whether we've enabled it */
154-
VIDEO_FLAG_HDR_SUPPORT = (1 << 7 ),
155+
VIDEO_FLAG_HDR_SUPPORT = (1 << 8 ),
155156
/* If set during context deinit, the driver should keep
156157
* graphics context alive to avoid having to reset all
157158
* context state. */
158-
VIDEO_FLAG_CACHE_CONTEXT = (1 << 8 ),
159+
VIDEO_FLAG_CACHE_CONTEXT = (1 << 9 ),
159160
/* Set to true by driver if context caching succeeded. */
160-
VIDEO_FLAG_CACHE_CONTEXT_ACK = (1 << 9 ),
161-
VIDEO_FLAG_ACTIVE = (1 << 10),
162-
VIDEO_FLAG_STATE_OUT_RGB32 = (1 << 11),
163-
VIDEO_FLAG_CRT_SWITCHING_ACTIVE = (1 << 12),
164-
VIDEO_FLAG_FORCE_FULLSCREEN = (1 << 13),
165-
VIDEO_FLAG_IS_SWITCHING_DISPLAY_MODE = (1 << 14),
166-
VIDEO_FLAG_SHADER_PRESETS_NEED_RELOAD = (1 << 15),
167-
VIDEO_FLAG_CLI_SHADER_DISABLE = (1 << 16),
168-
VIDEO_FLAG_RUNAHEAD_IS_ACTIVE = (1 << 17)
161+
VIDEO_FLAG_CACHE_CONTEXT_ACK = (1 << 10),
162+
VIDEO_FLAG_ACTIVE = (1 << 11),
163+
VIDEO_FLAG_STATE_OUT_RGB32 = (1 << 12),
164+
VIDEO_FLAG_CRT_SWITCHING_ACTIVE = (1 << 13),
165+
VIDEO_FLAG_FORCE_FULLSCREEN = (1 << 14),
166+
VIDEO_FLAG_IS_SWITCHING_DISPLAY_MODE = (1 << 15),
167+
VIDEO_FLAG_SHADER_PRESETS_NEED_RELOAD = (1 << 16),
168+
VIDEO_FLAG_CLI_SHADER_DISABLE = (1 << 17),
169+
VIDEO_FLAG_RUNAHEAD_IS_ACTIVE = (1 << 18)
169170
};
170171

171172
struct LinkInfo

intl/msg_hash_us.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6157,13 +6157,13 @@ MSG_HASH(
61576157
MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_SAVE_STATE,
61586158
"Display an on-screen message when saving and loading save states."
61596159
)
6160-
MSG_HASH(
6160+
MSG_HASH( /* FIXME: Rename config key and msg hash */
61616161
MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_FAST_FORWARD,
6162-
"Fast-Forward Notifications"
6162+
"Frame Throttle Notifications"
61636163
)
61646164
MSG_HASH(
61656165
MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_FAST_FORWARD,
6166-
"Display an on-screen indicator when fast-forwarding content."
6166+
"Display an on-screen indicator when fast-forward, slow-motion or rewind is active."
61676167
)
61686168
MSG_HASH(
61696169
MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_SCREENSHOT,

runloop.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4049,7 +4049,7 @@ static void runloop_apply_fastmotion_override(runloop_state_t *runloop_st,
40494049
#if defined(HAVE_GFX_WIDGETS)
40504050
if ( p_dispwidget->active
40514051
&& !(runloop_st->flags & RUNLOOP_FLAG_FASTMOTION))
4052-
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FAST_FORWARD;
4052+
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FASTMOTION;
40534053
#endif
40544054
}
40554055

@@ -6471,15 +6471,15 @@ static enum runloop_state_enum runloop_check_state(
64716471
#if defined(HAVE_GFX_WIDGETS)
64726472
if (widgets_active)
64736473
{
6474-
if (rewinding)
6474+
if (rewinding && settings->bools.notification_show_fast_forward)
64756475
video_st->flags |= VIDEO_FLAG_WIDGETS_REWINDING;
64766476
else
64776477
video_st->flags &= ~VIDEO_FLAG_WIDGETS_REWINDING;
64786478
}
64796479
else
64806480
#endif
64816481
{
6482-
if (rewinding)
6482+
if (rewinding && settings->bools.notification_show_fast_forward)
64836483
runloop_msg_queue_push(s, strlen(s), 0, t, true, NULL,
64846484
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
64856485
}
@@ -6792,12 +6792,12 @@ static enum runloop_state_enum runloop_check_state(
67926792
if (settings->bools.notification_show_fast_forward)
67936793
{
67946794
if (runloop_st->flags & RUNLOOP_FLAG_FASTMOTION)
6795-
video_st->flags |= VIDEO_FLAG_WIDGETS_FAST_FORWARD;
6795+
video_st->flags |= VIDEO_FLAG_WIDGETS_FASTMOTION;
67966796
else
6797-
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FAST_FORWARD;
6797+
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FASTMOTION;
67986798
}
67996799
else
6800-
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FAST_FORWARD;
6800+
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FASTMOTION;
68016801
}
68026802
else
68036803
#endif
@@ -6815,7 +6815,7 @@ static enum runloop_state_enum runloop_check_state(
68156815
}
68166816
#if defined(HAVE_GFX_WIDGETS)
68176817
else
6818-
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FAST_FORWARD;
6818+
video_st->flags &= ~VIDEO_FLAG_WIDGETS_FASTMOTION;
68196819
#endif
68206820

68216821
#ifdef HAVE_CHEEVOS
@@ -6892,6 +6892,21 @@ static enum runloop_state_enum runloop_check_state(
68926892
old_slowmotion_button_state = new_slowmotion_button_state;
68936893
old_slowmotion_hold_button_state = new_slowmotion_hold_button_state;
68946894
}
6895+
6896+
#if defined(HAVE_GFX_WIDGETS)
6897+
if (widgets_active)
6898+
{
6899+
if (settings->bools.notification_show_fast_forward)
6900+
{
6901+
if (runloop_st->flags & RUNLOOP_FLAG_SLOWMOTION)
6902+
video_st->flags |= VIDEO_FLAG_WIDGETS_SLOWMOTION;
6903+
else
6904+
video_st->flags &= ~VIDEO_FLAG_WIDGETS_SLOWMOTION;
6905+
}
6906+
else
6907+
video_st->flags &= ~VIDEO_FLAG_WIDGETS_SLOWMOTION;
6908+
}
6909+
#endif
68956910
}
68966911

68976912
/* Check save state slot hotkeys */

0 commit comments

Comments
 (0)