mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Get rid of RARCH_TIMER_ macros
This commit is contained in:
parent
56e150d68f
commit
bd5295ca76
42
retroarch.c
42
retroarch.c
@ -15459,10 +15459,9 @@ static enum runloop_state_enum runloop_check_state(
|
||||
|
||||
if (!timer.timer_begin)
|
||||
{
|
||||
uint64_t current_usec = cpu_features_get_time_usec();
|
||||
RARCH_TIMER_BEGIN_NEW_TIME_USEC(timer,
|
||||
current_usec,
|
||||
SHADER_FILE_WATCH_DELAY_MSEC * 1000);
|
||||
timer.timeout_us = SHADER_FILE_WATCH_DELAY_MSEC * 1000;
|
||||
timer.current = cpu_features_get_time_usec();
|
||||
timer.timeout_end = timer.current + timer.timeout_us;
|
||||
timer.timer_begin = true;
|
||||
timer.timer_end = false;
|
||||
}
|
||||
@ -15478,12 +15477,16 @@ static enum runloop_state_enum runloop_check_state(
|
||||
*/
|
||||
if (need_to_apply)
|
||||
{
|
||||
RARCH_TIMER_TICK(timer, current_time);
|
||||
timer.current = current_time;
|
||||
timer.timeout_us = timer.timeout_end - timer.current;
|
||||
|
||||
if (!timer.timer_end && RARCH_TIMER_HAS_EXPIRED(timer))
|
||||
if ( !timer.timer_end
|
||||
&& timer.timeout_us <= 0)
|
||||
{
|
||||
RARCH_TIMER_END(timer);
|
||||
need_to_apply = false;
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
need_to_apply = false;
|
||||
command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL);
|
||||
}
|
||||
}
|
||||
@ -15494,21 +15497,24 @@ static enum runloop_state_enum runloop_check_state(
|
||||
{
|
||||
if (!runloop_st->shader_delay_timer.timer_begin)
|
||||
{
|
||||
uint64_t current_usec = cpu_features_get_time_usec();
|
||||
RARCH_TIMER_BEGIN_NEW_TIME_USEC(
|
||||
runloop_st->shader_delay_timer,
|
||||
current_usec,
|
||||
settings->uints.video_shader_delay * 1000);
|
||||
runloop_st->shader_delay_timer.timer_begin = true;
|
||||
runloop_st->shader_delay_timer.timer_end = false;
|
||||
runloop_st->shader_delay_timer.timeout_us = settings->uints.video_shader_delay * 1000;
|
||||
runloop_st->shader_delay_timer.current = cpu_features_get_time_usec();
|
||||
runloop_st->shader_delay_timer.timeout_end = runloop_st->shader_delay_timer.current
|
||||
+ runloop_st->shader_delay_timer.timeout_us;
|
||||
runloop_st->shader_delay_timer.timer_begin = true;
|
||||
runloop_st->shader_delay_timer.timer_end = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_TIMER_TICK(runloop_st->shader_delay_timer, current_time);
|
||||
runloop_st->shader_delay_timer.current = current_time;
|
||||
runloop_st->shader_delay_timer.timeout_us = runloop_st->shader_delay_timer.timeout_end
|
||||
- runloop_st->shader_delay_timer.current;
|
||||
|
||||
if (RARCH_TIMER_HAS_EXPIRED(runloop_st->shader_delay_timer))
|
||||
if (runloop_st->shader_delay_timer.timeout_us <= 0)
|
||||
{
|
||||
RARCH_TIMER_END(runloop_st->shader_delay_timer);
|
||||
runloop_st->shader_delay_timer.timer_end = true;
|
||||
runloop_st->shader_delay_timer.timer_begin = false;
|
||||
runloop_st->shader_delay_timer.timeout_end = 0;
|
||||
|
||||
{
|
||||
const char *preset = retroarch_get_shader_preset();
|
||||
|
@ -1,19 +1,3 @@
|
||||
#define RARCH_TIMER_TICK(_timer, current_time) \
|
||||
_timer.current = current_time; \
|
||||
_timer.timeout_us = (_timer.timeout_end - _timer.current) \
|
||||
|
||||
#define RARCH_TIMER_END(_timer) \
|
||||
_timer.timer_end = true; \
|
||||
_timer.timer_begin = false; \
|
||||
_timer.timeout_end = 0
|
||||
|
||||
#define RARCH_TIMER_BEGIN_NEW_TIME_USEC(_timer, current_usec, timeout_usec) \
|
||||
_timer.timeout_us = timeout_usec; \
|
||||
_timer.current = current_usec; \
|
||||
_timer.timeout_end = _timer.current + _timer.timeout_us
|
||||
|
||||
#define RARCH_TIMER_HAS_EXPIRED(_timer) ((_timer.timeout_us <= 0))
|
||||
|
||||
#define DRIVERS_CMD_ALL \
|
||||
( DRIVER_AUDIO_MASK \
|
||||
| DRIVER_VIDEO_MASK \
|
||||
|
Loading…
x
Reference in New Issue
Block a user