Fix #1558: world map preview ignores map editor bpp setting - #2964
Open
joshgoebel wants to merge 1 commit into
Open
Fix #1558: world map preview ignores map editor bpp setting#2964joshgoebel wants to merge 1 commit into
joshgoebel wants to merge 1 commit into
Conversation
initWorld() always used tic_tool_peek4() to read tile pixels, which hardcodes 4bpp regardless of the bpp mode selected in the map editor. This caused incorrect colors in the world map overview when using 2bpp or 1bpp tiles. Replace the hardcoded peek4 loop with a tic_tilesheet / tic_tileptr lookup that uses the segment derived from map->sheet.blit, matching the approach used by the sprite and map editors. tic_tilesheet_gettilepix then reads pixel values correctly for the active bpp mode. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Closes #1558
What
The world map overview (Tab in the map editor) always rendered using 4bpp regardless of the bpp mode selected in the map editor toolbar. This caused incorrect colors for cartridges using 2bpp or 1bpp tiles.
Root cause
initWorld()usedtic_tool_peek4()to read every tile's pixel data, hardcoding 4bpp interpretation:Fix
Use
tic_tilesheet_getwith the segment derived frommap->sheet.blit(the same blit state the map editor uses), then read pixels viatic_tilesheet_gettilepixwhich dispatches to the correctpeek1/peek2/peek4function for the active bpp mode. This mirrors the approach already used by the sprite and map editors.