Improve WangBrush and TileLayerWangEdit behavior with empty color by bjorn · Pull Request #3774 · mapeditor/tiled (original) (raw)
added 8 commits
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 added a commit that referenced this pull request
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.
bjorn deleted the wangedit-improvements branch
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
[ Show hidden characters]({{ revealButtonHref }})