From fd5e6958faf26e411089e1f3f53017b0ab45f444 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 27 Feb 2015 02:26:15 +0100 Subject: [PATCH] (Overlay) Should now properly set up first overlay screen as quickly as possible --- input/input_overlay.c | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/input/input_overlay.c b/input/input_overlay.c index 584e8b7bdd..8fec27a0e3 100644 --- a/input/input_overlay.c +++ b/input/input_overlay.c @@ -451,6 +451,20 @@ static bool input_overlay_resolve_targets(struct overlay *ol, return true; } +static void input_overlay_load_active(input_overlay_t *ol, + float opacity) +{ + if (!ol) + return; + + ol->iface->load(ol->iface_data, ol->active->load_images, + ol->active->load_images_size); + + input_overlay_set_alpha_mod(ol, opacity); + input_overlay_set_vertex_geom(ol); + ol->iface->full_screen(ol->iface_data, ol->active->full_screen); +} + bool input_overlay_load_overlays_resolve_iterate(input_overlay_t *ol) { bool not_done = true; @@ -472,6 +486,14 @@ bool input_overlay_load_overlays_resolve_iterate(input_overlay_t *ol) goto error; } + if (ol->resolve_pos == 0) + { + ol->active = &ol->overlays[0]; + + input_overlay_load_active(ol, ol->deferred.opacity); + input_overlay_enable(ol, ol->deferred.enable); + } + ol->resolve_pos += 1; return true; @@ -510,7 +532,6 @@ bool input_overlay_load_overlays_iterate(input_overlay_t *ol) if (!not_done) { - ol->resolve_pos = 0; ol->state = OVERLAY_STATUS_DEFERRED_LOADING_RESOLVE; return true; } @@ -539,6 +560,8 @@ bool input_overlay_load_overlays_iterate(input_overlay_t *ol) } break; case OVERLAY_IMAGE_TRANSFER_DESC_DONE: + if (ol->pos == 0) + input_overlay_load_overlays_resolve_iterate(ol); ol->pos += 1; ol->loading_status = OVERLAY_IMAGE_TRANSFER_NONE; break; @@ -704,30 +727,12 @@ error: return false; } -static void input_overlay_load_active(input_overlay_t *ol, - float opacity) -{ - if (!ol) - return; - - ol->iface->load(ol->iface_data, ol->active->load_images, - ol->active->load_images_size); - - input_overlay_set_alpha_mod(ol, opacity); - input_overlay_set_vertex_geom(ol); - ol->iface->full_screen(ol->iface_data, ol->active->full_screen); -} bool input_overlay_new_done(input_overlay_t *ol) { if (!ol) return false; - ol->active = &ol->overlays[0]; - - input_overlay_load_active(ol, ol->deferred.opacity); - input_overlay_enable(ol, ol->deferred.enable); - input_overlay_set_alpha_mod(ol, ol->deferred.opacity); input_overlay_set_scale_factor(ol, ol->deferred.scale_factor); ol->next_index = (ol->index + 1) % ol->size;