-
Notifications
You must be signed in to change notification settings - Fork 102
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
Support for Web Assembly #228
Comments
Just as a workaround you can use the |
Thanks you. Do you have any idea when it's going to be officially included in the crate? |
Hopefully on 0.12. Futures are a bit tricky to implement. 0.11 will have support for custom sync readers though. |
Leaving this here for other users, as a workaround for the crate to work with wasm you'll need to disable the zstd feature and a fully embedded map (Doesn't refer to external files, with the exception of images). |
Sorry I didn't mention the embedded map thing before, I immediately assumed you needed to refer to external files given your description. If you can choose to use fully embedded maps instead, I recommend using those instead. The crate won't call |
For the record, "embedded map" here is referring to storing a map with all tilesets embedded. However, I would not recommend embedding the tilesets in the working copy of your map if you're sharing them between multiple maps. Instead, you can export the map (File > Export) and rely on the "Embed tilesets" export option (Preferences > General > Export Options). If you're using templates, be sure to enable the "Detach templates" export option as well. |
I was curious if a very small change would suffice, so I tried adjusting TMX parsing to first check the cache, then use This is a very small change to the code base, here: current...petersn:rs-tiled:current I added
If you add
to I could turn this into a PR if folks are interested, but I assume that the goal would be to do something less hacky, in particular with this |
@petersn That's a nice approach, and I think actually this can already be done without any changes to Lines 156 to 163 in bfd67ca
The Lines 159 to 162 in bfd67ca
And the Lines 42 to 45 in bfd67ca
Maybe you could let us know whether this already suffices. |
@bjorn Thanks for the pointers, that looks great. Seems like it'll already suffice for my purposes, I'll switch to |
@petersn Check out the 0.11 changelog for a high-level overview of the changes: https://github.com/mapeditor/rs-tiled/blob/next/CHANGELOG.md @aleokdev Maybe it would make sense to do a 0.11 release, even when not all its goals have been met yet? |
I'll try to review all the changes done in the |
@aleokdev I've opened #246 for merging |
@bjorn Apparently the change in TileData is breaking as we are adding a new public member to a fully public struct, so we need to bundle that with 0.11 anyway. I can stash that change and release 0.10.3 with the other changes. |
@aleokdev Ok, then I don't see much value in doing a 0.10.3 and think we could just go for 0.11.0, but up to you. |
Closing this as |
The crate won't work on Web Assembly even with zstd disabled, because the
load_tmx_map_from
function internally callsFile::open
, which returns an error on wasm targets.The text was updated successfully, but these errors were encountered: