From e86efd320ceec5631f1ed60229e24336d9d2f0fc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 7 Mar 2015 17:15:42 +0100 Subject: [PATCH] Create g_runloop.frame.video.current.menu.is_animated and g_runloop.frame.video.current.menu.framebuf_dirty - will be used to inform processes or runloops outside of RA's runloop that video update needs to happen because of animations or video state changes occurring. --- general.h | 8 ++++++++ menu/menu.c | 3 +++ menu/menu_animation.c | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/general.h b/general.h index 1d78eb6583..a94354a3ac 100644 --- a/general.h +++ b/general.h @@ -466,6 +466,14 @@ struct runloop { unsigned count; unsigned max; + struct + { + struct + { + bool is_animated; + bool framebuf_dirty; + } menu; + } current; } video; struct diff --git a/menu/menu.c b/menu/menu.c index a6511cfe97..ec434d1836 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -385,6 +385,9 @@ int menu_iterate(retro_input_t input, menu->dt = IDEAL_DT / 4; menu->old_time = menu->cur_time; + g_runloop.frames.video.current.menu.is_animated = false; + g_runloop.frames.video.current.menu.framebuf_dirty = false; + if (driver.menu_ctx) { if (driver.menu_ctx->set_texture) diff --git a/menu/menu_animation.c b/menu/menu_animation.c index ffe71b7521..8b348e53fc 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -18,6 +18,7 @@ #include #include #include +#include "../general.h" /* from https://github.com/kikito/tween.lua/blob/master/tween.lua */ @@ -442,7 +443,12 @@ void menu_animation_update(animation_t *animation, float dt) menu_animation_iterate(&animation->list[i], dt, &active_tweens); if (!active_tweens) + { animation->size = 0; + return; + } + + g_runloop.frames.video.current.menu.is_animated = true; } /** @@ -502,4 +508,6 @@ void menu_animation_ticker_line(char *buf, size_t len, unsigned idx, strlcpy(buf, str + str_len - len, len + 1); else strlcpy(buf, str + right_offset, len + 1); + + g_runloop.frames.video.current.menu.is_animated = true; }