Skip to content

[pull] master from beyond-all-reason:master - #88

Merged
pull[bot] merged 3 commits into
ExaDev:masterfrom
beyond-all-reason:master
Sep 4, 2026
Merged

[pull] master from beyond-all-reason:master#88
pull[bot] merged 3 commits into
ExaDev:masterfrom
beyond-all-reason:master

Conversation

@pull

@pull pull Bot commented Sep 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Ruwetuin and others added 3 commits September 4, 2026 14:21
…am[, fullView]]) (#3206)

* Added gl.DrawMiniMapIcons(left, top, right, bottom, iconSize[, allyTeam[, fullView]])

add `gl.DrawMiniMapIcons(left, top, right, bottom, iconSize[, allyTeam[, fullView]])`, which draws all unit icons visible to the given perspective (team colors, radar dots, LOS rules, ghost dimming — exactly as on the minimap) for a map-space rectangle, mapped onto the unit square under the current transform. Composes with `gl.RenderToTexture`/FBOs, so widgets (e.g. picture-in-picture views) can render icon layers for any camera rect and zoom without maintaining their own icon pipeline.
- `allyTeam` and `fullView` default to the local view; other perspectives (e.g. for casting) require a full-read Lua handle.

* addressed sprungs comments

1. Magic 8 → named + documented. It's now constexpr float MAX_ICON_SCALE_MULT = 8.0f with a comment explaining what it bounds: the per-icon scale multiplier the drawer applies (icontypes.lua size, times radius/30 for radiusAdjust icons), and the failure mode when exceeded (an oversized icon can pop at the cull-rect edge; callers that care can pad their rectangle). Reply to sprunk: "Yes — an upper bound on the per-icon scale multiplier (icontypes size × radiusAdjust factor); now named and documented, including the pop-at-edge consequence for icons beyond it."

2. Rect validation → strict ordering with epsilon. The check is now !((right - left) > float3::cmp_eps()) || !((bottom - top) > float3::cmp_eps()) — which rejects flipped, degenerate, near-degenerate, and NaN rects (the !(a > b) form catches NaN where a < b wouldn't), instead of only exact equality. I went with your "also fail if left > right" option rather than renaming to x1/x2: mirroring costs the caller nothing since they control the transform the unit square lands in, and a strict contract keeps the docs and the cull setup simpler (the std::min/max there is gone). Docstring updated to say so.

3. fullView gate → sprunk's condition adopted, plus one addition. They were right, and it cut both ways: my symmetric fullView != gu->spectatingFullView check errored on a restricted handle requesting less visibility than the global state (harmless), and — worse — permitted a restricted handle to render godmode whenever the global state happened to be fullview, leaking past the handle's read scope. Now: (allyTeam != gu->myAllyTeam || fullView) && !fullRead errors — requesting fullView always demands fullRead, restricting never does. The addition worth mentioning in your reply: the default for the parameter is now gu->spectatingFullView && GetHandleFullRead(L) — without that clamp, sprunk's stricter check would have made a bare 5-argument call error from a restricted handle during fullview spectating, since the old default blindly inherited the global fullview state.

* Update rts/Lua/LuaOpenGL.cpp

Co-authored-by: sprunk <spr.ng@o2.pl>

* reverted changelog -> moved into doc/pr-changelogs\3206.md

* added addition param: @PARAM highlightSelected boolean? (Default: true) draw the local player's selected units white. Other players' selections are unknown to the engine — when rendering another perspective, pass false and overlay that viewer's selection yourself

added param highlightSelected (Default: true) draw the local player's selected units white.

---------

Co-authored-by: sprunk <spr.ng@o2.pl>
> warning: space between quotes and suffix is deprecated in C++23
Fixes #3177. Seems a missed side effect of #1509.
@pull pull Bot locked and limited conversation to collaborators Sep 4, 2026
@pull pull Bot added the ⤵️ pull label Sep 4, 2026
@pull
pull Bot merged commit a51bf9b into ExaDev:master Sep 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants