Repository navigation
fix(3D view): stops fast flashing of flat 2D while the camera scrolls - #213
Merged
Merged
Conversation
MapShownPct compared gRoomControls.scroll against the latched BG registers, which can be a tile apart for a frame while scrolling. Score the camera tile and its 8 neighbours and keep the best. Adds opt-in TMC_VOXEL_DEBUG logging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Result: the 3D view holds steady while walking and during camera pans, instead of flashing back to the flat 2D frame a few times a second.
Files:
port/port_voxel.cppNot in v0.9.5. It affects anyone on
masterusing the 3D view (Windows/Linux Vulkan builds), and fixing it is a step toward making the 3D view usable day to day.Cause
MapShownPct()takes the room position fromgRoomControls.scroll_*but the BG position from the latchedBGxHOFS/VOFS. While scrolling, the two can be a tile apart for a frame. The score then drops toward 0,BottomMapShown()fails, and that frame falls back to 2D. Logging confirmed every fallback was during normal gameplay (GAMEMAIN_UPDATE).Change
MapShownPct()scores the camera offset and its 8 neighbours (±8 px) and keeps the best, so a one-tile lag no longer reads as "map not on screen".TMC_VOXEL_DEBUG=1: logs each 2D fallback (task/state/substate, room size, match %) and each geometry rebuild with its reason. Off by default. Happy to drop it if you'd rather not carry it.Why this fix
Tested (Windows, Vulkan, USA,
TMC_VOXEL_DEBUG=1)Developed with assistance from Claude Code (Opus 5.5). I reviewed and tested the changes as described above.