Skip to content
Snippets Groups Projects
Commit d7979759 authored by Kyle Simpson's avatar Kyle Simpson
Browse files

Expose `parse_with_path`.

parent c8bef8f1
No related branches found
No related tags found
No related merge requests found
......@@ -912,6 +912,14 @@ fn parse_impl<R: Read>(reader: R, map_path: Option<&Path>) -> Result<Map, TiledE
}
}
/// Parse a buffer hopefully containing the contents of a Tiled file and try to
/// parse it. This augments `parse` with a file location: some engines
/// (e.g. Amethyst) simply hand over a byte stream (and file location) for parsing,
/// in which case this function may be required.
pub fn parse_with_path<R: Read>(reader: R, path: &Path) -> Result<Map, TiledError> {
parse_impl(reader, Some(path))
}
/// Parse a file hopefully containing a Tiled map and try to parse it. If the
/// file has an external tileset, the tileset file will be loaded using a path
/// relative to the map file's path.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment