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

Add support for virtual filesystems. #43

Open
holywyvern opened this issue Dec 27, 2019 · 4 comments
Open

Add support for virtual filesystems. #43

holywyvern opened this issue Dec 27, 2019 · 4 comments
Labels

Comments

@holywyvern
Copy link

I am attempting to integrate physfs with this library, and it has some troubles with nested resources.
In other words, when I load a map with a tsx file included, because the library uses fopen instead of a custom handler, you can't use it.

Is there a way to integrate a virtual filesystem, like adding some callbacks like "tmx_load_file_fn" or "tmx_load_tileset_fn" ?

@baylej baylej added the feature label Apr 10, 2020
@edin-m
Copy link

edin-m commented Aug 21, 2020

Could tmx_load_buffer() be of use here? Load from physfs to char* buffer then use this func to parse.

@mupfdev
Copy link

mupfdev commented Aug 22, 2020

This would be very helpful to use libTMX on Android. I created a fork especially for this purpose: https://github.com/mupfelofen-de/tmx-android

A way to register respective callback functions would probably a quite elegant solution. Haven't thought about that.

@holywyvern
Copy link
Author

Could tmx_load_buffer() be of use here? Load from physfs to char* buffer then use this func to parse.

Oh it almost works, it works if you embed the resources on the tilemap, but if you want to keep them separate, tmx loads the assets individually, so load buffer will load the first one just fine, but any dependency will try to be loaded using the standard file system.

@holywyvern
Copy link
Author

holywyvern commented Sep 4, 2020

This would be very helpful to use libTMX on Android. I created a fork especially for this purpose: https://github.com/mupfelofen-de/tmx-android

A way to register respective callback functions would probably a quite elegant solution. Haven't thought about that.

I did end up making a fork with a virtual file system:
https://github.com/holywyvern/tmx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants