(Menu) cleaner dt formulas

This commit is contained in:
Jean-André Santoni 2015-02-24 01:09:14 +01:00
parent 319fcca439
commit b6e214128a
4 changed files with 12 additions and 7 deletions

View File

@ -26,6 +26,7 @@
#include <file/file_path.h>
#include "../../gfx/gl_common.h"
#include "../../performance.h"
#include "../../gfx/video_thread_wrapper.h"
#include <compat/posix_string.h>
@ -36,7 +37,7 @@
#endif
#ifndef XMB_DELAY
#define XMB_DELAY 0.02
#define XMB_DELAY 10
#endif
typedef struct
@ -1136,7 +1137,7 @@ static void xmb_frame(void)
if (!gl)
return;
menu_animation_update(menu->animation, menu->dt / 8000000.0);
menu_animation_update(menu->animation, menu->dt / IDEAL_DT);
glViewport(0, 0, gl->win_width, gl->win_height);

View File

@ -376,10 +376,10 @@ int menu_iterate(retro_input_t input,
menu->cur_time = rarch_get_time_usec();
menu->dt = menu->cur_time - menu->old_time;
if (menu->dt > 30000)
menu->dt = 30000;
if (menu->dt < 4000)
menu->dt = 4000;
if (menu->dt >= IDEAL_DT * 2)
menu->dt = IDEAL_DT * 2;
if (menu->dt <= IDEAL_DT / 2)
menu->dt = IDEAL_DT / 2;
menu->old_time = menu->cur_time;
if (driver.menu_ctx)

View File

@ -497,7 +497,7 @@ unsigned menu_input_frame(retro_input_t input, retro_input_t trigger_input)
menu->mouse.enable = g_settings.menu.mouse_enable;
menu->delay.count += menu->dt / 10000.0;
menu->delay.count += menu->dt / IDEAL_DT;
if (driver.block_input)
trigger_input = 0;

View File

@ -44,6 +44,10 @@ extern "C" {
#define MAX_COUNTERS 64
#endif
#ifndef IDEAL_DT
#define IDEAL_DT (1.0 / 60.0 * 1000000.0)
#endif
extern const struct retro_perf_counter *perf_counters_rarch[MAX_COUNTERS];
extern const struct retro_perf_counter *perf_counters_libretro[MAX_COUNTERS];
extern unsigned perf_ptr_rarch;