mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
The per-turn visibility update of the range manager runs on MT_Update, which is broadcast before unit motion and before scripted components act. LOS changes later in the turn therefore leave regions flagged dirty during all the frames rendered until the next turn, so the renderer's once-per-turn GetLosVisibility query fell back to ComputeLosVisibility for every entity in such regions. That calls into the scripted Visibility component of every corpse near any fight once per turn from the render path (#8327), and shows end-of-turn visibility while positions are still interpolating across the turn (#5876). Add GetCachedLosVisibility, which trusts the visibility cache for dirty regions but still recomputes entities whose own state changed since the last update - so newly spawned entities (corpses, mirages) don't render hidden until the next turn - and use it for unit rendering and the minimap. The cached result is consistent with the VisibilityChanged messages. Simulation and UI callers keep the existing behaviour. Limiting the scripted visibility calls to the per-turn update was suggested by Itms and Vantha in #8327. |
||
|---|---|---|
| .. | ||
| test_CinemaManager.h | ||
| test_CommandQueue.h | ||
| test_HierPathfinder.h | ||
| test_ObstructionManager.h | ||
| test_Pathfinder.h | ||
| test_Position.h | ||
| test_RangeManager.h | ||
| test_scripts.h | ||
| test_TerritoryManager.h | ||