Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into layer-enum
Browse files Browse the repository at this point in the history
  • Loading branch information
aleokdev committed Jan 26, 2022
2 parents e546d92 + e3d0a5c commit c33233d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
28 changes: 9 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Tileset::columns`.
- `Layer::id`, `Layer::width` and `Layer::height`.
- Support for 'object'-type properties.
- Support for multiline string properties.
- Documentation for map members.
- Tests for `tiled_base64_zstandard.tmx`.
- `.gitattributes` for line ending consistency.
- Support for multiline string properties.
- MIT license file.

### Changed
- Reorganized crate:
- `parse_file`, `parse` -> `Map::parse_file` with optional path.
- `parse_with_path` -> `Map::parse_reader`
- `parse_tileset` -> `Tileset::parse`
- `Frame` has been moved to the `animation` module.
- `ParseTileError` & `TiledError` have been moved into the `error` module.
- `Image` has been moved into the `image` module.
- `LayerTile`, `LayerData`, `ImageLayer` & `Chunk` have been moved into the `layers` module.
- `Layer` has been renamed to `TileLayer` and has been moved into the `layers` module.
- `ObjectGroup` has been renamed to `ObjectLayer` and now resides in the `layers` module.
- `Map` & `Orientation` have been moved into the `map` module.
- `ObjectShape` & `Object` have been moved into the `objects` module.
- `Colour`, `PropertyValue` & `Properties` have been moved into the `properties` module.
- All mentions of `Colour` have been changed to `Color` for consistency with the Tiled dataformat.
- `Tile` has been moved into the `tile` module.
- `Tileset` has been moved into the `tileset` module.
- `Map::get_tileset_by_gid` -> `Map::tileset_by_gid`
- `Tile::object_group` -> `Tile::collision`
- `Layer` has been renamed to `TileLayer`, and the original `Layer` structure is now used
for common data from all layer types.
- `Map` now has a single `layers` member which contains layers of all types in order.
- Layer members that are common between types (i.e. `id`, `name`, `visible`, `opacity`, `offset_x`,
`offset_y` and `properties`) have been moved into `Layer`.
- `ObjectGroup` has been renamed to `ObjectLayer`.
- `parse_file`, `parse` -> `Map::parse_file` with optional path.
- `parse_with_path` -> `Map::parse_reader`.
- `parse_tileset` -> `Tileset::parse`.
- All mentions of `Colour` have been changed to `Color` for consistency with the Tiled dataformat.
- `Map::get_tileset_by_gid` -> `Map::tileset_by_gid`.
- `Layer::tiles` changed from `Vec<Vec<LayerTile>>` to `Vec<LayerTile>`.
- Tile now has `image` instead of `images`. ([Issue comment](https://github.com/mapeditor/rs-tiled/issues/103#issuecomment-940773123))
- Tileset now has `image` instead of `images`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ to the dependencies section of your Cargo.toml.
### Example

```rust
use tiled::map::Map;
use tiled::Map;

fn main() {
let map = Map::parse_file("assets/tiled_base64_zlib.tmx").unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use tiled::map::Map;
use tiled::Map;

fn main() {
let map = Map::parse_file("assets/tiled_base64_zlib.tmx").unwrap();
Expand Down
28 changes: 19 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
pub mod animation;
pub mod error;
pub mod image;
pub mod layers;
pub mod map;
pub mod objects;
pub mod properties;
pub mod tile;
pub mod tileset;
mod animation;
mod error;
mod image;
mod layers;
mod map;
mod objects;
mod properties;
mod tile;
mod tileset;
mod util;

pub use animation::*;
pub use error::*;
pub use image::*;
pub use layers::*;
pub use map::*;
pub use objects::*;
pub use properties::*;
pub use tile::*;
pub use tileset::*;
2 changes: 1 addition & 1 deletion tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::Path;
use std::{fs::File, path::PathBuf};
use tiled::layers::{LayerType, ObjectLayer, TileLayer};
use tiled::{
error::TiledError, layers::LayerData, map::Map, properties::PropertyValue, tileset::Tileset,
TiledError, LayerData, Map, PropertyValue, Tileset,
};

fn as_tile_layer(layer: &LayerType) -> &TileLayer {
Expand Down

0 comments on commit c33233d

Please sign in to comment.