0ad/source/simulation2/components/tests
josue ce249f4ef0 Don't recompute the LOS visibility of unchanged entities when rendering
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.
2026-06-12 18:09:56 +02:00
..
test_CinemaManager.h Revamp CinemaManager component 2026-03-03 11:25:52 +01:00
test_CommandQueue.h Fix includes in source/simulation2 2025-08-07 08:38:40 +02:00
test_HierPathfinder.h Fix includes in source/simulation2 2025-08-07 08:38:40 +02:00
test_ObstructionManager.h Replace M_PI with C++ numbers 2026-06-04 20:29:48 +02:00
test_Pathfinder.h Fix disabled pathfinder tests 2026-06-07 10:43:32 +02:00
test_Position.h Fix includes in source/simulation2 2025-08-07 08:38:40 +02:00
test_RangeManager.h Don't recompute the LOS visibility of unchanged entities when rendering 2026-06-12 18:09:56 +02:00
test_scripts.h Fix includes in source/simulation2 2025-08-07 20:00:49 +02:00
test_TerritoryManager.h Fix some includes all over the place 2025-08-14 20:15:30 +02:00