Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Add sparse and dense layers #16

Merged
merged 54 commits into from
Nov 20, 2020
Merged

Add sparse and dense layers #16

merged 54 commits into from
Nov 20, 2020

Conversation

joshuajbouw
Copy link
Owner

@joshuajbouw joshuajbouw commented Nov 18, 2020

One of the big milestones for data optimisation. Now it is possible to have sparse and dense layers as well as layer sprites ordered by Z level!

Changes

Fixed

  • Separated non-public API out
  • Fixed issue with tiles_to_renderer_parts (now dense_tiles_to_renderer_parts) which pushed ALL the tiles, not just a single layer.

Added

  • A lot more documentation
  • Added Z layers to the tile map
  • Versioned prelude with most likely used methods, traits, structs, enums

API Changed

  • MANY public API were sorted and removed from public API
  • Z layer added to TileSetter::push method:
  • MapResult -> TileMapResult
  • MapError -> TileMapError

Before

let mut setter = TileSetter::new();

// Sets a tile at x1, y1, z0.
setter.push(Vec3::new(1.0, 1.0, 0.0);

After

let mut setter = TileSetter::new();

// Sets a tile at x1, y1, z0 and z_layer 0.
setter.push(Vec3::new(1.0, 1.0, 0.0), 0);
  • DeprecatedTileMap::new_chunk_with_tiles (Sorry! No longer fits in the scope...)

Closes

#9 #6

@joshuajbouw joshuajbouw marked this pull request as draft November 18, 2020 15:15
@joshuajbouw joshuajbouw self-assigned this Nov 18, 2020
@joshuajbouw joshuajbouw added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Nov 18, 2020
This was linked to issues Nov 18, 2020
@joshuajbouw
Copy link
Owner Author

This is fairly feature complete up to this point.

src/tile_setter.rs Outdated Show resolved Hide resolved
src/tile_setter.rs Outdated Show resolved Hide resolved
src/tile_setter.rs Outdated Show resolved Hide resolved
src/tile_setter.rs Outdated Show resolved Hide resolved
src/tile_setter.rs Outdated Show resolved Hide resolved
src/chunk.rs Outdated Show resolved Hide resolved
src/chunk.rs Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
@joshuajbouw joshuajbouw marked this pull request as ready for review November 19, 2020 21:15
Copy link
Contributor

@alec-deason alec-deason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me. I still have some thoughts on minimizing the API but I want to work with it as is some before I push on that and it's out of scope for this PR anyway.

src/dimension.rs Outdated Show resolved Hide resolved
@joshuajbouw joshuajbouw merged commit f348f93 into master Nov 20, 2020
@joshuajbouw joshuajbouw deleted the layers branch November 20, 2020 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sparse and dense layers Sparse tilemap
3 participants