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

Tileset caching #17

Open
LubieKakao1212 opened this issue Jan 22, 2024 · 3 comments
Open

Tileset caching #17

LubieKakao1212 opened this issue Jan 22, 2024 · 3 comments

Comments

@LubieKakao1212
Copy link

I realized that external tilesets are loaded for each map separately and there is no way to cache them since in your implementation tilesets contain information about first gid. I propose changing Tileset references in ExternalTileset to ITiIeset and make ExternalTileset not propagate the FirstGid property but instead offset the gid in this[int gid].

Also will fork this repo and apply the second change I mentioned (without a PR) because I need this feature for GlobalGameJam which is starting "soon".

@Ragath
Copy link
Owner

Ragath commented Jan 22, 2024

you can do caching, it would be done by passing your own loader here

public static Map FromStream(Stream stream, Func<ExternalTileset, Stream> tsLoader = null)

As for the FirstGid property, it's merely matching Tiled's behavior. But if this has changed over the years, I will implement a migration for the version change and adjust the behavior.

@LubieKakao1212
Copy link
Author

That's what I did, but still ExternalTileset would propagate FirstGid to the Tileset and cause errors when reading the tiles.
Also as far as I understand the specification FirstGid is a property present in the map and not the tileset

@LubieKakao1212
Copy link
Author

Is object rotation not supported? Or am I missing something?

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

No branches or pull requests

2 participants