menu widgets: fix rounding error with timings
This commit is contained in:
parent
277b5c9462
commit
4e74e52518
|
@ -1263,7 +1263,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||||
const struct retro_message *msg = (const struct retro_message*)data;
|
const struct retro_message *msg = (const struct retro_message*)data;
|
||||||
RARCH_LOG("Environ SET_MESSAGE: %s\n", msg->msg);
|
RARCH_LOG("Environ SET_MESSAGE: %s\n", msg->msg);
|
||||||
#ifdef HAVE_MENU_WIDGETS
|
#ifdef HAVE_MENU_WIDGETS
|
||||||
if (!menu_widgets_set_libretro_message(msg->msg, msg->frames / 60 * 1000))
|
if (!menu_widgets_set_libretro_message(msg->msg, roundf((float)msg->frames / 60.0f * 1000.0f)))
|
||||||
#endif
|
#endif
|
||||||
runloop_msg_queue_push(msg->msg, 3, msg->frames, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
runloop_msg_queue_push(msg->msg, 3, msg->frames, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -3210,7 +3210,7 @@ void runloop_msg_queue_push(const char *msg,
|
||||||
runloop_ctx_msg_info_t msg_info;
|
runloop_ctx_msg_info_t msg_info;
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (menu_widgets_msg_queue_push(msg,
|
if (menu_widgets_msg_queue_push(msg,
|
||||||
duration / 60 * 1000, title, icon, category, prio, flush))
|
roundf((float)duration / 60.0f * 1000.0f), title, icon, category, prio, flush))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue