Merge pull request #1442 from lakkatv/xmb

(Menu) Delta timing
This commit is contained in:
Twinaphex 2015-02-24 10:31:44 +11:00
commit 54163d20fc
4 changed files with 16 additions and 4 deletions

View File

@ -1136,7 +1136,7 @@ static void xmb_frame(void)
if (!gl)
return;
menu_animation_update(menu->animation, 0.002);
menu_animation_update(menu->animation, menu->dt / 7500000.0);
glViewport(0, 0, gl->win_width, gl->win_height);

View File

@ -21,6 +21,7 @@
#include "../dynamic.h"
#include "../frontend/frontend.h"
#include "../../retroarch.h"
#include "../../performance.h"
#include <file/file_path.h>
/**
@ -377,6 +378,12 @@ int menu_iterate(retro_input_t input,
int32_t ret = 0;
unsigned action = menu_input_frame(input, trigger_input);
menu_handle_t *menu = menu_driver_resolve();
menu->cur_time = rarch_get_time_usec();
menu->dt = menu->cur_time - menu->old_time;
menu->old_time = menu->cur_time;
if (driver.menu_ctx)
{
if (driver.menu_ctx->set_texture)

View File

@ -98,11 +98,16 @@ typedef struct
{
void *userdata;
/* Delta timing */
float dt;
float cur_time;
float old_time;
/* Used for key repeat */
struct
{
unsigned timer;
unsigned count;
float timer;
float count;
} delay;
size_t begin;

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->delay.count += menu->dt / 10000.0;
if (driver.block_input)
trigger_input = 0;