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

The order of image/tile layers cannot be serialized in the original order #3

Closed
gurkenlabs opened this issue Apr 18, 2017 · 0 comments

Comments

@gurkenlabs
Copy link
Collaborator

gurkenlabs commented Apr 18, 2017

In contrast to the original .tmx approach, we use an object model for the XML serialization of the map instead of manually serializing the layers.
We do enhance the tile- and imagelayers by an order property but this is not compatible backwards, which might result in losing the original order of the layers when serializing.
Because we're serializing two collections of layers it is not possible to mix the layer order between those elements. Within the layer types, the order is correct but if the order was originally something like

- TileLayer 1
- ImageLayer 1
- TileLayer 2

our serialization will result in the order

- TileLayer 1
- TileLayer 2
- ImageLayer 1

which would result in a wrong rendering order for the Tiled Editor and maybe other renderers.

@gurkenlabs gurkenlabs reopened this Apr 18, 2017
TheRamenChef added a commit that referenced this issue Mar 4, 2019
#3 is closed, but that doesn't mean I can't address it.
nightm4re94 pushed a commit that referenced this issue Mar 4, 2019
* Preserve layer ordering

#3 is closed, but that doesn't mean I can't address it.

* Remove some missed serial version UIDs

* Something to fix in the MapRenderer

* Implement group layers

I don't really see any way to avoid lots of duplicated code here, as
Java doesn't allow multiple inheritance outside of interfaces.

* Rewrite the map orientations.

This replaces the MapOrientation enum and many of the MapUtilities
methods with an IMapOrientation interface and a MapOrientations class
containing a selection of singleton implementations of that interface.
It also implements the two isometric orientations.

* Tweak the implementations a bit

Also implement render order.

* Now that my IDE is showing me these things

Also, IEntityProvider should be passed as a Supplier<IEntity> or as just
the entity.

* Prevent possible nullReference.

* Prevent / handle more errors.
nightm4re94 pushed a commit that referenced this issue Nov 27, 2020
* Add JavaFX to classpath

* Figured out how to make JavaFX compile with jdk8 and jdk11

* Travis needs OpenJFX 8 to compile for Java 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants