-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix & add tests for template object loading #227
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<template> | ||
<object type="wall" width="16" height="16"/> | ||
</template> |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<template> | ||
<object type="wall" width="16" height="32"/> | ||
</template> |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tileset version="1.5" tiledversion="1.7.2" name="wang_tileset" tilewidth="32" tileheight="32" tilecount="18" columns="6"> | ||
<image source="../tilesheet.png" width="192" height="96"/> | ||
<tile id="0"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="1" type="wall" x="0" y="0" width="32" height="32"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="1"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="corner.tx" x="0" y="16"/> | ||
<object id="3" template="corner.tx" x="0" y="0"/> | ||
<object id="4" template="corner.tx" x="16" y="0"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="2"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="edge.tx" x="0" y="16" rotation="270"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="3"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="1" template="corner.tx" x="0" y="0"/> | ||
<object id="2" template="corner.tx" x="16" y="0"/> | ||
<object id="3" template="corner.tx" x="16" y="16"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="4"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="corner.tx" x="16" y="16"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="5"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="corner.tx" x="0" y="16"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="6"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="1" type="wall" x="0" y="16" width="16" height="16"/> | ||
<object id="2" type="wall" x="16" y="0" width="16" height="16"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="7"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="1" template="edge.tx" x="0" y="0"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="9"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="edge.tx" x="16" y="0"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="10"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="corner.tx" x="16" y="0"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="11"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="corner.tx" x="0" y="0"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="12"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" type="wall" x="0" y="0" width="16" height="16"/> | ||
<object id="3" type="wall" x="16" y="16" width="16" height="16"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="13"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="corner.tx" x="0" y="0"/> | ||
<object id="3" template="corner.tx" x="0" y="16"/> | ||
<object id="4" template="corner.tx" x="16" y="16"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="14"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="edge.tx" x="32" y="16" rotation="90"/> | ||
</objectgroup> | ||
</tile> | ||
<tile id="15"> | ||
<objectgroup draworder="index" id="2"> | ||
<object id="2" template="corner.tx" x="16" y="0"/> | ||
<object id="3" template="corner.tx" x="16" y="16"/> | ||
<object id="4" template="corner.tx" x="0" y="16"/> | ||
</objectgroup> | ||
</tile> | ||
<wangsets> | ||
<wangset name="grass_walls" type="corner" tile="6"> | ||
<wangcolor name="walls" color="#ff0000" tile="0" probability="1"/> | ||
<wangcolor name="grass" color="#00ff00" tile="8" probability="1"/> | ||
<wangtile tileid="0" wangid="0,1,0,1,0,1,0,1"/> | ||
<wangtile tileid="1" wangid="0,1,0,2,0,1,0,1"/> | ||
<wangtile tileid="2" wangid="0,1,0,2,0,2,0,1"/> | ||
<wangtile tileid="3" wangid="0,1,0,1,0,2,0,1"/> | ||
<wangtile tileid="4" wangid="0,2,0,1,0,2,0,2"/> | ||
<wangtile tileid="5" wangid="0,2,0,2,0,1,0,2"/> | ||
<wangtile tileid="6" wangid="0,1,0,2,0,1,0,2"/> | ||
<wangtile tileid="7" wangid="0,2,0,2,0,1,0,1"/> | ||
<wangtile tileid="8" wangid="0,2,0,2,0,2,0,2"/> | ||
<wangtile tileid="9" wangid="0,1,0,1,0,2,0,2"/> | ||
<wangtile tileid="10" wangid="0,1,0,2,0,2,0,2"/> | ||
<wangtile tileid="11" wangid="0,2,0,2,0,2,0,1"/> | ||
<wangtile tileid="12" wangid="0,2,0,1,0,2,0,1"/> | ||
<wangtile tileid="13" wangid="0,2,0,1,0,1,0,1"/> | ||
<wangtile tileid="14" wangid="0,2,0,1,0,1,0,2"/> | ||
<wangtile tileid="15" wangid="0,1,0,1,0,1,0,2"/> | ||
</wangset> | ||
</wangsets> | ||
</tileset> |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tileset version="1.5" tiledversion="1.7.2" name="simple_figure" tilewidth="32" tileheight="32" tilecount="18" columns="3"> | ||
<image source="../tilesheet.png" width="96" height="192"/> | ||
</tileset> |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<template> | ||
<tileset firstgid="1" source="simple_figure.tsx"/> | ||
<object name="simple_figure" type="simple_figure" gid="1" width="32" height="32"> | ||
<properties> | ||
<property name="playable" type="bool" value="false"/> | ||
</properties> | ||
</object> | ||
</template> |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we pass in the parent directory to
LayerData::new
in the first place? Or does themap_path
parameter toImageLayerData::new
andGroupLayerData::new
need to be the actual map path?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change that, but I was trying to change as few lines as possible since you asked to patch just the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's appreciated! It just highlighted that the inconsistency goes further than this one line. But, we can merge this fix and make it consistent in a follow-up change.
For following this up, I think we should always pass just the directory.