Skip to content
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

Next -> Current #259

Merged
merged 19 commits into from
Mar 16, 2023
Merged

Next -> Current #259

merged 19 commits into from
Mar 16, 2023

Conversation

aleokdev
Copy link
Contributor

No description provided.

aleokdev and others added 19 commits March 22, 2022 12:15
* Add VFS support

* Add some docs

* Fix tests & docs

* Better docs for `Loader::new`

* Address code review comments

* Misc doc improvements

* Rename FilesystemResourceCache
* Enforce ResourceReader errors to be Send + Sync

* Add cache_mut and reader_mut methods
* Remove `Layer` suffix from `LayerType` variants

* Pluralize `Tile` & `Object` variants
* Change version

* Update changelog
Conflicts:
	Cargo.toml
	README.md
	src/cache.rs
	src/loader.rs
* Added template support

This patch adds support for templates. Templates are a property on Objects
that specify an external file to load object properties by default. In
this implementation, templates are not visible to the end user, their
behaviour happens "automatically".

As it parses, the Map will generate a list of templates, with each being
identified by their ID.

Templates introduce the concept of a tile that is bound to a tileset
that is not part of the main map's list of tilesets. For this reason,
the tileset_index() function now returns Option<usize>. Internally, an
enum is used to signify whether the tileset is map or template bound.

I had to change the signature of the Resource cache, because the
generator function now needs access to the cache.

* Handle error on template base_path.parent()

* LayerTileData object now can contain a templ. arc

Rather than an id into some list, this now contains an arc to the
tileset directly. Makes the code cleaner, and allows caching to behave
better, but can have performance implications.

* Removed some more template list Vecs

These should have been removed last commit, whoops!

* Responded to review comments

* Don't bind attributes property to a name

Squishes an "unused" warning.

* Cargo fmt and updated test

* Update changelog

* Clippy fixes

* Simplify LayerTileData and create ObjectTileData

* Fix clippy warnings

* Simplify implementation

* Apply suggestions from code review

* Remove outdated comment

* Address PR comments

* Trigger CI & handle review comment

Co-authored-by: alexdevteam <alexpro820@gmail.com>
Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Co-authored-by: aleokdev <aleok.inf@gmail.com>
* Rendering example for ggez

* Update ggez example

* Refactoring for ggez example

* Re-add example entry I accidently removed

* Add note about caching layer_batches in ggez ex

* Update contributors list

* Change format string in ggez example to work on older rust versions

* Add libasound2-dev and libudev-dev to rust workflow apt install

* ggez: use CARGO_MANIFEST_DIR

Co-authored-by: Alejandro Perea <alexpro820@gmail.com>

* ggez: destructure some variables

Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>

* ggez: more destructuring

* ggez: make left mouse also drag

* ggez: reduce time_since_start calls, make get_tile_rect return Rect

* Use the Loader

* Refactor some minor things

* Don't center the map by default

* Add batch caching to ggez example

Cache gets invalidated when panning/zooming or every frame while animating
The performance improvement would be more noticeable if there were more layers & more tilesets per layer

* Cargo fmt

* Polish

* Fixed 'bounds' function and removed unused import

* Apparently clippy check now needs alsa

thread 'main' panicked at '`"pkg-config" "--libs" "--cflags" "alsa"` did not exit successfully: exit status: 1
error: could not find system library 'alsa' required by the 'alsa-sys' crate

* Also install udev dependency

"Package libudev was not found in the pkg-config search path."

Co-authored-by: Alejandro Perea <alexpro820@gmail.com>
Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Co-authored-by: aleokdev <aleok.inf@gmail.com>
* Add assets

Co-authored-by: Adam Aposhian <aposhian.dev@gmail.com>

* Make DefaultResourceCache's members `pub`

* Update changelog

* Fix directory/file path errors

Co-authored-by: Adam Aposhian <aposhian.dev@gmail.com>
Merge current into next
* Add text shapes

* Address PR comments

* Update changelog
Conflicts:
	.github/workflows/rust.yml
	src/objects.rs
* Add ResourceReader example

* Add `OrientationParseError`

* Rename `TileData::tile_type`

* Update changelog

* Remove deprecated members

* Update changelog

* Fix build
@aleokdev aleokdev merged commit 6dff214 into current Mar 16, 2023
@aleokdev aleokdev deleted the next branch March 16, 2023 17:29
@aleokdev aleokdev restored the next branch March 16, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants