From b97ac5d495ce82e6f1cf051c3f3a29ff38c91982 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 00:21:55 +0100 Subject: Skybox image: fix HDR sky binding; clip checkbox/arrow drawing The HDR sky materials use the "sky" shader with $hdrcompressedtexture (DXT5). Assigning an RGBA8 procedural texture there sampled as compressed data and rendered black. Point $hdrbasetexture at the image, undefine $hdrcompressedtexture (and its 0/1/2 variants) so the shader falls back, and call IMaterial::Refresh (37) because the sky shader binds textures in SHADER_INIT, which is otherwise cached. GUI: draw_checkbox and the card expand chevron ignored the content clip, so cards scrolled out of view leaked header widgets outside the window. Log the first regenerator call (size/pitch/first pixel) for diagnosis. --- src/gui.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'src/gui.cpp') diff --git a/src/gui.cpp b/src/gui.cpp index eb53dff..ebc1f62 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -1672,10 +1672,11 @@ void gui_handle_input() { // Draw // --------------------------------------------------------------------------- -static void draw_checkbox(int x, int y, bool on) { +static void draw_checkbox(int x, int y, bool on, + const Rect *clip = nullptr) { Rect box{x, y, S(15.0f), S(15.0f)}; - fill(box, on ? C_ACCENT : Col{30, 34, 42, 255}); - outline(box, C_BORDER); + fill(box, on ? C_ACCENT : Col{30, 34, 42, 255}, clip); + outline(box, C_BORDER, clip); if (on) { line(x + S(3.0f), y + S(8.0f), x + S(7.0f), y + S(12.0f), C_BG); line(x + S(7.0f), y + S(12.0f), x + S(13.0f), y + S(4.0f), C_BG); @@ -1719,14 +1720,17 @@ static void draw_card(const Rect &clip, int index, int y) { Rect head{cr.x, cr.y, cr.w, hh}; fill(head, C_HEADER, &clip); - // expand arrow + // expand arrow (clipped like the rest of the card; header rows of cards + // scrolled out of view must not leak into the window chrome) int ax = cr.x + S(10.0f), ay = cr.y + (hh - S(8.0f)) / 2; - if (c.expanded) { - line(ax, ay, ax + S(4.0f), ay + S(5.0f), C_DIM); - line(ax + S(4.0f), ay + S(5.0f), ax + S(8.0f), ay, C_DIM); - } else { - line(ax, ay, ax + S(5.0f), ay + S(4.0f), C_DIM); - line(ax + S(5.0f), ay + S(4.0f), ax, ay + S(8.0f), C_DIM); + if (ay >= clip.y && ay + S(8.0f) <= clip.y + clip.h) { + if (c.expanded) { + line(ax, ay, ax + S(4.0f), ay + S(5.0f), C_DIM); + line(ax + S(4.0f), ay + S(5.0f), ax + S(8.0f), ay, C_DIM); + } else { + line(ax, ay, ax + S(5.0f), ay + S(4.0f), C_DIM); + line(ax + S(5.0f), ay + S(4.0f), ax, ay + S(8.0f), C_DIM); + } } // title (wraps instead of truncating) @@ -1741,7 +1745,7 @@ static void draw_card(const Rect &clip, int index, int y) { if (c.feat) { bool active = c.feat->active; int active_y = cr.y + (hh - S(18.0f)) / 2; - draw_checkbox(cr.x + cr.w - S(170.0f), active_y, active); + draw_checkbox(cr.x + cr.w - S(170.0f), active_y, active, &clip); text_in(clip, cr.x + cr.w - S(148.0f), active_y + (S(18.0f) - g_body_h) / 2, active ? "On" : "Off", g_font_body, g_body_h, 0, active ? C_GOOD : C_DIM); @@ -1798,7 +1802,8 @@ static void draw_card(const Rect &clip, int index, int y) { maxw, C_TEXT, S(2.0f)); if (ct.kind == CK_TOGGLE) { bool on = ctrl_val(ct) != 0; - draw_checkbox(cr.x + cr.w - S(31.0f), by + (rh - S(15.0f)) / 2, on); + draw_checkbox(cr.x + cr.w - S(31.0f), by + (rh - S(15.0f)) / 2, on, + &clip); text_in(clip, cr.x + cr.w - S(58.0f), by + (rh - g_body_h) / 2, on ? "On" : "Off", g_font_body, g_body_h, 0, on ? C_GOOD : C_DIM); -- cgit v1.2.3