From 41c5688fca69bbb314cd848950174763a940662a Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 31 Jul 2021 19:11:40 +1000 Subject: [PATCH] [client] overlay: let the overlay know if it's in interactive mode This also removes the need for the flags member as the overlay can just opt to not render if it's not in interactive mode. --- client/include/interface/overlay.h | 9 --------- client/src/app.c | 3 ++- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/client/include/interface/overlay.h b/client/include/interface/overlay.h index 7377c4b1..13916eb8 100644 --- a/client/include/interface/overlay.h +++ b/client/include/interface/overlay.h @@ -26,12 +26,6 @@ #include "common/types.h" -enum LG_OverlayFlags -{ - /* requires mouse interaction */ - LG_OVERLAY_INTERACTIVE = (1U << 1U), -}; - struct LG_OverlayOps { /* internal name of the overlay for debugging */ @@ -43,9 +37,6 @@ struct LG_OverlayOps /* final free */ void (*free)(void * udata); - /* general state flags, may be changed at any time */ - enum LG_OverlayFlags flags; - /* perform the actual drawing/rendering * * `interactive` is true if the application is currently in overlay interaction diff --git a/client/src/app.c b/client/src/app.c index fe9b869b..30c47b33 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -752,7 +752,8 @@ int app_renderOverlay(struct Rect * rects, int maxRects) ll_walk(g_state.overlays, (void **)&overlay); ) { const int written = - overlay->ops->render(overlay->udata, false, buffer, MAX_OVERLAY_RECTS); + overlay->ops->render(overlay->udata, g_state.overlayInput, + buffer, MAX_OVERLAY_RECTS); for (int i = 0; i < written; ++i) {