Repository navigation
perf(worldbuilder): Skip object refresh while painting terrain tiles - #128
Merged
Merged
Conversation
Every mouse move of the tile tool refreshed the terrain and then refitted every map object, build list entry, light and scorch to the ground, and flagged all roads and bridges to be rebuilt on the next redraw. Painting textures or pathing never changes heights, so the tile tool now skips that refresh. Full terrain rebuilds and height edits still refresh as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NTMNjbth2DjLNN9Vz87n2v
Andreas-W
force-pushed
the
claude/project-thread-yemcpu
branch
from
October 26, 2026 06:54
a8267a8 to
51fd387
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.
Requested by Andreas · project thread
Why
Painting terrain tiles in WorldBuilder gets slow on real maps. On every mouse move, the tile tool's partial terrain update ends in
WbView3d::updateHeightMapInView, which callsinvalObjectInView(nullptr). That call:m_needToLoadRoads, so the next redraw (forced right away byUpdateWindow) rebuilds all roads and bridgesupdateLights) and rebuilds all scorches (updateScorches)The cost grows with the number of objects, roads and lights on the map, not with the size of the brush. None of it is needed while painting, because painting textures or pathing never changes heights.
What
CWorldBuilderDoc::updateHeightMapandWbView::updateHeightMapInViewtake an optionalinvalObjectsflag (defaulttrue, so every other caller behaves as before).WbView3d::updateHeightMapInViewskipsinvalObjectInView(nullptr)only for partial updates withinvalObjects == false. Full rebuilds always refresh objects.TileTool::mouseMoved(also covers the big tile tool) passesfalse.Testing
Not compiled yet: the change was written in a Linux container without the MSVC/MFC toolchain. It needs a
z_worldbuilderbuild and a quick paint test on a map with many objects and roads.Generated by Claude Code