Skip to content
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

Wang Improvements #2888

Merged
merged 41 commits into from
Oct 8, 2020
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0139dda
Unified Wang colors
bjorn Aug 12, 2020
8c168b7
Made drawing with a blob tileset somewhat work
bjorn Aug 19, 2020
4066a99
Added 'Duplicate Wang Set' action
bjorn Aug 25, 2020
700c151
Allow a Wang set to have only a single color
bjorn Aug 25, 2020
e51d55d
WangFiller: Some code cleanups
bjorn Aug 25, 2020
40c0e01
Replaced WangIdVariations with a mask
bjorn Aug 25, 2020
390bb10
Introduced a helper class for infinite grid of values
bjorn Aug 26, 2020
4eef072
WangBrush and WangFiller changes
bjorn Aug 26, 2020
23ad47f
Each tool now has a pointer to the active map scene
bjorn Sep 1, 2020
f4c0cda
Added a helper class for debug rendering to a MapScene
bjorn Sep 1, 2020
a9f7592
Wang Brush: Allow capturing empty color
bjorn Sep 1, 2020
f2cc126
Added two more Wang sets for testing purposes
bjorn Sep 1, 2020
249fc38
Used WangFiller::fillRegion for the Stamp Brush as well
bjorn Sep 2, 2020
df05802
WangFiller cleanups and made it work for staggered maps again
bjorn Sep 6, 2020
dfe8d3c
Enabled erasing with the Wang Brush
bjorn Sep 8, 2020
5aa374c
Wang Brush: Added mode in which neighbors are adjusted
bjorn Sep 8, 2020
9a82977
Fixed compile error about undefined reference on MinGW
bjorn Sep 9, 2020
da6edd3
Avoid double lookup in RandomPicker::take
bjorn Sep 9, 2020
f7d86eb
When doing Wang fill, require the borders to match existing tiles
bjorn Sep 9, 2020
2749ba1
Increased Wang set maximum color count from 15 to 255
bjorn Sep 9, 2020
d85fec0
Read terrain types as Wang colors
bjorn Sep 9, 2020
c6cd573
docs: Further Wang-related documentation updates for TMX and JSON
bjorn Sep 9, 2020
ced1223
Lua plugin: Write out Wang sets
bjorn Sep 9, 2020
0400f2c
Removed Terrain-related stuff from the UI
bjorn Sep 9, 2020
b18e4fb
Fixed compile error
bjorn Sep 9, 2020
fddbd03
Reduced opacity on Wang overlay fill
bjorn Sep 15, 2020
9a5d377
JSON format: Read terrain types as Wang colors
bjorn Sep 15, 2020
2eb7a19
Introduced the Wang set type
bjorn Sep 16, 2020
424101d
Improved the Wang tileset overlay
bjorn Sep 16, 2020
16db05e
Removed all terrain-related code from Tiled
bjorn Sep 16, 2020
cbb2bcd
Improved Wang Brush behavior when drawing edges
bjorn Sep 16, 2020
5a6d0e8
Scripting: Added initial API for Wang sets
bjorn Sep 22, 2020
94172fe
Added alternative triangle-overlay for edge Wang sets
bjorn Sep 22, 2020
db5394c
Wang Sets view: Made the "Colors" tab show by default
bjorn Sep 22, 2020
2ea4b23
Choose a fitting Wang set type when loading an old Wang set
bjorn Sep 22, 2020
daf8461
Added alternative non-connected-edges code path for mixed Wang sets
bjorn Sep 22, 2020
57e5113
docs: Documented the new Wang set API
bjorn Sep 23, 2020
620d01a
Wang Brush: Choose a meaningful mode for "Mixed" Wang sets
bjorn Sep 23, 2020
6b35338
Wang Brush: Added rotational symmetry mode
bjorn Oct 6, 2020
2979823
WangFiller: Avoid processing points for correction multiple times
bjorn Oct 6, 2020
5dc79c7
Wang Brush: Added line drawing with Shift modifier
bjorn Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Wang Brush: Allow capturing empty color
This should enable erasing with the Wang Brush (there should also be
another way of entering the erasing mode, though).
  • Loading branch information
bjorn committed Sep 9, 2020
commit a9f759267c7d7f526c394b991a3a79e3586b17d5
14 changes: 6 additions & 8 deletions src/tiled/wangbrush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,13 @@ void WangBrush::captureHoverColor()

const QPoint mousePoint = mPaintPoint - tileLayer->position();
const Cell &cell = tileLayer->cellAt(mousePoint);
const WangId wangId = mWangSet->wangIdOfCell(cell);
const int newColor = wangId.indexColor(mWangIndex);

if (const WangId wangId = mWangSet->wangIdOfCell(cell)) {
const int newColor = wangId.indexColor(mWangIndex);

if (newColor && newColor != mCurrentColor) {
mCurrentColor = newColor;
emit colorCaptured(newColor);
updateBrush();
}
if (newColor != mCurrentColor) {
setColor(newColor);
emit colorCaptured(newColor);
updateBrush();
}
}

Expand Down