From b5b59608ddea20f2c6c184d380366c6069d9634b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 8 Mar 2015 16:55:25 +0100 Subject: [PATCH] Add three ways to indicate that the menu should update video - (1) an animation is active, (2) a label has its contents updated (can be a message ticker or say an FPS monitor label being constantly updated, and (3) the menu framebuffer is 'dirty' (meaning its contents has changed and therefore we need to upload it again to the GPU. --- general.h | 16 ++++++++++++++-- menu/menu.c | 5 +++-- menu/menu_animation.c | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/general.h b/general.h index 5635d52ad0..e160940142 100644 --- a/general.h +++ b/general.h @@ -470,8 +470,20 @@ struct runloop { struct { - bool is_animated; - bool framebuf_dirty; + struct + { + bool is_updated; + } label; + + struct + { + bool is_active; + } animation; + + struct + { + bool dirty; + } framebuf; } menu; } current; } video; diff --git a/menu/menu.c b/menu/menu.c index ec434d1836..60bfe5bab0 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -385,8 +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; + g_runloop.frames.video.current.menu.animation.is_active = false; + g_runloop.frames.video.current.menu.label.is_updated = false; + g_runloop.frames.video.current.menu.framebuf.dirty = false; if (driver.menu_ctx) { diff --git a/menu/menu_animation.c b/menu/menu_animation.c index 8b348e53fc..dd4fb03377 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -448,7 +448,7 @@ void menu_animation_update(animation_t *animation, float dt) return; } - g_runloop.frames.video.current.menu.is_animated = true; + g_runloop.frames.video.current.menu.animation.is_active = true; } /** @@ -509,5 +509,5 @@ void menu_animation_ticker_line(char *buf, size_t len, unsigned idx, else strlcpy(buf, str + right_offset, len + 1); - g_runloop.frames.video.current.menu.is_animated = true; + g_runloop.frames.video.current.menu.animation.is_active = true; }