diff --git a/CHANGELOG.md b/CHANGELOG.md index 540fdda6..81578ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,19 +19,19 @@ objects. As such, `ResourceCache` has now methods for both getting and inserting - `ResourceCache::get_or_try_insert_tileset_with` has been replaced by `ResourceCache::insert_tileset`. - `DefaultResourceCache`'s members have been made public. -## [Unreleased] +## [0.10.3] ### Added - Support for Wang sets. - Support for Tiled 1.9 `Class` property. Maps, tilesets and layers now have a `user_type` property. - Support for tile offsets. Tilesets now have an `offset_x` and `offset_y` property. ### Deprecated -- `Tile::tile_type`: Use `Tile::user_type` instead. - `Object::obj_type` Use `Object::user_type` instead. ### Changed - Update `zstd` to `0.12.0`. -- Update `sfml` dev dependency to `0.19.0`. +- Update `sfml` dev dependency to `0.20.0`. +- Update `base64` to `0.21.0`. ## [0.10.2] ### Added diff --git a/Cargo.toml b/Cargo.toml index cac74c6d..7701c98d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,13 +31,13 @@ name = "ggez" path = "examples/ggez/main.rs" [dependencies] -base64 = "0.13.0" +base64 = "0.21.0" xml-rs = "0.8.4" libflate = "1.1.2" zstd = { version = "0.12.0", optional = true } [dev-dependencies.sfml] -version = "0.19.0" +version = "0.20.0" features = ["graphics"] [dev-dependencies.ggez] diff --git a/README.md b/README.md index 19081c63..c5d2362b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ tiled = "0.11.0" [![Rust](https://github.com/mapeditor/rs-tiled/actions/workflows/rust.yml/badge.svg)](https://github.com/mapeditor/rs-tiled/actions/workflows/rust.yml) [![Crates.io](https://img.shields.io/crates/v/tiled.svg)](https://crates.io/crates/tiled) -[![dependency status](https://deps.rs/crate/tiled/0.10.2/status.svg)](https://deps.rs/crate/tiled/0.10.2) +[![dependency status](https://deps.rs/crate/tiled/latest/status.svg)](https://deps.rs/crate/tiled) A crate for reading TMX (map) and TSX (tileset) files from the [Tiled Map Editor](http://www.mapeditor.org/) into Rust. It provides a huge set of features as well as a strong wrapper over internal features such as GIDs. diff --git a/src/layers/tile/mod.rs b/src/layers/tile/mod.rs index 2eb7ab4e..163a9bcf 100644 --- a/src/layers/tile/mod.rs +++ b/src/layers/tile/mod.rs @@ -57,7 +57,7 @@ impl LayerTileData { | Self::FLIPPED_VERTICALLY_FLAG | Self::FLIPPED_DIAGONALLY_FLAG; - /// Creates a new [`LayerTileData`] from a [`GID`] plus its flipping bits. + /// Creates a new [`LayerTileData`] from a [`Gid`] plus its flipping bits. pub(crate) fn from_bits(bits: u32, tilesets: &[MapTilesetGid]) -> Option { let flags = bits & Self::ALL_FLIP_FLAGS; let gid = Gid(bits & !Self::ALL_FLIP_FLAGS); diff --git a/src/layers/tile/util.rs b/src/layers/tile/util.rs index e1820f43..4f3c4f90 100644 --- a/src/layers/tile/util.rs +++ b/src/layers/tile/util.rs @@ -1,5 +1,6 @@ use std::{convert::TryInto, io::Read}; +use base64::Engine; use xml::reader::XmlEvent; use crate::{util::XmlEventResult, Error, LayerTileData, MapTilesetGid, Result}; @@ -36,7 +37,12 @@ fn parse_base64(parser: &mut impl Iterator) -> Result { - return base64::decode(s.trim().as_bytes()).map_err(Error::Base64DecodingError) + return base64::engine::GeneralPurpose::new( + &base64::alphabet::STANDARD, + base64::engine::general_purpose::PAD, + ) + .decode(s.trim().as_bytes()) + .map_err(Error::Base64DecodingError) } XmlEvent::EndElement { name, .. } if name.local_name == "data" => { return Ok(Vec::new()); diff --git a/src/map.rs b/src/map.rs index 69ab1777..c0bbabf8 100644 --- a/src/map.rs +++ b/src/map.rs @@ -302,7 +302,7 @@ impl fmt::Display for Orientation { /// Tiled also treats GID 0 as empty space, which means that the first tileset in the map will have /// a starting GID of 1. /// -/// See also: https://doc.mapeditor.org/en/latest/reference/global-tile-ids/ +/// See also: #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub(crate) struct Gid(pub u32); diff --git a/src/tile.rs b/src/tile.rs index d706dd57..6b6131cf 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -27,9 +27,8 @@ pub struct TileData { /// The animation frames of this tile. pub animation: Option>, /// The type of this tile. - pub user_type: Option, - /// This property has been renamed to `user_type`. - #[deprecated(since = "0.10.3", note = "Use [`TileData::user_type`] instead")] + // TODO(0.11.0): Rename to `user_type` (https://github.com/mapeditor/rs-tiled/pull/238, postponed because of + // breaking change) pub tile_type: Option, /// The probability of this tile. pub probability: f32, @@ -112,8 +111,7 @@ impl TileData { properties, collision: objectgroup, animation, - tile_type: user_type.clone(), - user_type, + tile_type: user_type, probability: probability.unwrap_or(1.0), }, ))