Fix all sprites vanishing in straight view at max zoom - #5066
Merged
Loobinex merged 1 commit intoJul 29, 2026
Conversation
Member
|
fix makes sense yeah, but the comments claude adds are bit redundant, could you clean those up? |
The sprite size term (camera_zoom << 13) is computed in 32 bits and wraps once camera_zoom reaches 262144 (the last two zoom stages at 4K resolution) - the negative result makes draw_fastview_mapwho cull every thing sprite. Widen the intermediate to 64-bit, the same treatment dkfans#5060 gave project_point_helper. The dkfans#5062 depth bias in draw_frontview_thing_on_element computes the same expression, so it gets the same widening and stays correct at the zoom levels this fix makes reachable again. Reproduced on alpha 1.4.0.5252. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RupixTalahone
force-pushed
the
fix/frontview-sprite-size-overflow
branch
from
July 27, 2026 13:15
b0e04d7 to
63bb460
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
In the straight view, zooming to the last two zoom stages at high resolution makes every thing sprite disappear: creatures, lair totems, the dungeon heart. Floors and walls keep rendering, the inhabitants vanish.
Mechanism
draw_fastview_mapwho sizes sprites with (camera_zoom << 13) in 32-bit math. Resolution-scaled zoom reaches camera_zoom >= 262144 at 4K, the shift wraps negative, and the negative size culls every sprite. Same overflow family as #5060, which fixed the sibling term in project_point_helper.
The fix
Widen the intermediate to 64-bit, identical math otherwise. The depth bias merged in #5062 computes the same expression in draw_frontview_thing_on_element, so it gets the same widening and stays correct at the zoom levels this fix makes reachable again.
Testing
Reproduced the vanish on the official alpha 1.4.0.5252 build, then A/B tested a local build of master with this patch on the same machine: every sprite stays visible through max zoom and lair totems render whole there.
🤖 Generated with Claude Code