-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve WangBrush and TileLayerWangEdit behavior with empty color #3774
Merged
Conversation
This file contains 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
Mostly removing the special handling for erasing and changing the way filling is implemented.
* Slightly simplified updateAdjacent (one less call to "oppositeIndex"). * In wangIdFromSurrounding, prefer colors over "no color". * In WangFiller::wangIdFromSurroundings, don't let tiles outside of a fixed map contribute to the WangId. * Don't require tiles on the border of the region to match their surroundings, but only prefer them to.
Also slightly optimized it based on WangId::mergeWith.
Also exposed the new TileLayerWangEdit.erasingEnabled property in the scripting API. Another change is that empty tiles no longer contribute to the desired WangId for the Terrain Fill mode (when corrections are disabled). Previously, only tiles outside of the map would not contribute to the desired WangId. This change yields nicer behavior when using the Wang Fill mode with the Stamp Brush, but it may need to be reconsidered for the Shape Fill tool or a later Terrain Fill tool.
This avoids the problem, that tiles set outside of the map by the algorithm will affect the tiles inside the map, which is not desirable. Also, explicitly set tiles that are outside of the map to empty. This seems like a good idea, since it means the preview will still highlight those areas, but it will not affect the map once applied.
…bled Don't let unset indices from the WangId based on surroundings override colors from currently present tiles.
bjorn
force-pushed
the
wangedit-improvements
branch
from
July 6, 2023 15:14
754fec8
to
70c0ca0
Compare
bjorn
added a commit
that referenced
this pull request
Jul 6, 2023
Mostly removing the special handling for erasing and changing the way filling is implemented. This does mean that terrain sets now support only 254 colors (down from 255). * Slightly simplified updateAdjacent (one less call to "oppositeIndex"). * In wangIdFromSurrounding, prefer colors over "no color". * In WangFiller::wangIdFromSurroundings, don't let empty tiles contribute to the WangId. * Don't require tiles on the border of the region to match their surroundings, but only prefer them to. * Slightly optimized WangBrush rotational symmetry mode. * Disabled placement of empty tiles by Stamp Brush in Terrain Fill mode. * Added TileLayerWangEdit.erasingEnabled property in the scripting API. * WangFiller: Don't try to make changes outside of a fixed map. This avoids the problem, that tiles set outside of the map by the algorithm will affect the tiles inside the map, which is not desirable. Also, explicitly set tiles that are outside of the map to empty. This seems like a good idea, since it means the preview will still highlight those areas, but it will not affect the map once applied.
Not sure what went wrong here, but GitHub provided me only with a rebase button that executed directly, even though I wanted to squash the commits. I've force-pushed the squashed version now (336569e). |
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.
Mostly removing the special handling for erasing and changing the way filling is implemented. Should also improve the new TileLayerWangEdit behavior when erasing.