-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scripting: Added API for editing tile layers using terrain sets (#3758)
* Added TileLayer.wangEdit, which returns a TileLayerWangEdit instance * Moved shared functionality from WangBrush to WangFiller * Fixed issue in WangFiller::findBestMatch when corrections are not enabled Co-authored-by: Thorbjørn Lindeijer <[email protected]>
- Loading branch information
1 parent
c5c6971
commit fcd9733
Showing
20 changed files
with
601 additions
and
165 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* | ||
* wangset.cpp | ||
* Copyright 2017, Benjamin Trotter <[email protected]> | ||
* | ||
* This file is part of libtiled. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -218,7 +219,7 @@ bool WangId::hasEdgeWithColor(int value) const | |
/** | ||
* Rotates the wang Id clockwise by (90 * rotations) degrees. | ||
* Meaning with one rotation, the top edge becomes the right edge, | ||
* and the top right corner, becomes the top bottom. | ||
* and the top right corner, becomes the bottom right. | ||
*/ | ||
void WangId::rotate(int rotations) | ||
{ | ||
|
@@ -727,7 +728,7 @@ QList<WangTile> WangSet::sortedWangTiles() const | |
* 6|X|2 | ||
* 5|4|3 | ||
*/ | ||
WangId WangSet::wangIdFromSurrounding(const WangId surroundingWangIds[]) const | ||
WangId WangSet::wangIdFromSurrounding(const WangId surroundingWangIds[]) | ||
{ | ||
quint64 id = 0; | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* | ||
* wangset.h | ||
* Copyright 2017, Benjamin Trotter <[email protected]> | ||
* | ||
* This file is part of libtiled. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -277,7 +278,7 @@ class TILEDSHARED_EXPORT WangSet : public Object | |
|
||
QList<WangTile> sortedWangTiles() const; | ||
|
||
WangId wangIdFromSurrounding(const WangId surroundingWangIds[]) const; | ||
static WangId wangIdFromSurrounding(const WangId surroundingWangIds[]); | ||
WangId wangIdFromSurrounding(const Cell surroundingCells[]) const; | ||
|
||
WangId wangIdOfTile(const Tile *tile) const; | ||
|
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
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
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
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
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
Oops, something went wrong.