-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
libtiled: tileset source should be read relative to the tmx, not current directory #2924
Comments
This seems to be working fine with the TMXMapReader.readMap(URL) variant added in #2829. Which unfortunately is not in the latest maven artifact (1.2.3). I'll close this issue, and create a new one about the maven artifact being outdated. |
@hoxu But this issue is still relevant for the String version of |
No. I created this issue too hastily and with poor details, apologies. I tested this again with both the latest maven artifact and manually built snapshot, and
The problem is in the I think it would make sense to either 1) add a path parameter that is used instead of |
@hoxu Alright, thanks for the additional info! I think I would go for option 1 since I guess there is still some extra flexibility compared to requiring a URL. Is it something you would like to patch up? |
TMXMapReader.unmarshalTileset
callsTMXMapReader.makeUrl
to convert a tileset source path to a URL:https://github.com/bjorn/tiled/blob/3fee6ebfa08a949c30e1324ca6a3da0765309524/util/java/libtiled-java/src/main/java/org/mapeditor/io/TMXMapReader.java#L114-L120
The path of the tmx being loaded is not used, so the tileset source is assumed to be in the current directory. This is an invalid assumption, as tiled itself saves a path relative to the tmx.
Relevant part of stack trace:
TMXMapReader.unmarshalTileset
should construct a path from the tmx file's directory and the (relative)<tileset source="...">
.The text was updated successfully, but these errors were encountered: