Skip to content

Draw the terrain selector highlight after flushing the tile batch - #146

Closed
Giszmo wants to merge 1 commit into
masterfrom
junior/fix-terrain-selector-batch-order
Closed

Giszmo wants to merge 1 commit into
masterfrom
junior/fix-terrain-selector-batch-order

Conversation

@Giszmo

@Giszmo Giszmo commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked bugfix from PR #132 (fix/fullscreen-scaling), split out to shrink #132/#129's diff against master per Leo's request.

In GL mode the terrain and resource sheets are uniform-size atlases, so their sprites are queued until finishDrawingSprite. Drawing the highlight before the batch flushed put it behind (or ahead of, depending on batching order) the terrain sprites it should sit above.

Original commit: 4cbe0f6

In GL mode the terrain and resource sheets are uniform-size atlases, so
their sprites are queued until finishDrawingSprite. The gamegui sheet
has mixed sizes and draws immediately, so the selection frame landed
under the tile that was flushed afterwards and the editor never showed
which terrain was selected. Flush the tile first, then draw the frame.
genixpro
genixpro previously approved these changes Sep 6, 2026

@genixpro genixpro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the focused diff and validated it against current master. The combined set applies cleanly after the five already merged fixes and builds successfully on macOS arm64; this PR has green Ubuntu 22.04, Ubuntu 24.04, and Windows CI.

@genixpro
genixpro dismissed their stale review September 6, 2026 01:14

Superseding provisional compile-only approval while behavior-focused testing is completed.

@genixpro

genixpro commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Current already flushes the terrain batch before drawing the selector highlight in . The old branch conflicts after the editor refactor. This PR is superseded on current master.

@kylelutze

Copy link
Copy Markdown
Contributor

Already on master — landed with the #132 merge (86d0398); the draw code now lives in src/map/edit/WidgetsTools.cpp, hence the conflict here.

@kylelutze kylelutze closed this Sep 6, 2026
@kylelutze
kylelutze deleted the junior/fix-terrain-selector-batch-order branch September 6, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants