-
Notifications
You must be signed in to change notification settings - Fork 270
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
cute_aseprite.h - v1.3 Tilesets Discussion #350
Comments
I don't personally have time to quite make all these changes myself right now, as I'm not currently useing Aseprite tileset feature in any projects. If anyone has time to contribute a PR here that would be greatly appreciated! (@mathewmariani maybe?) |
I will have time in July to start looking into these todos. Another change I would consider looking into would be to separate the zlib decoding into its own function, as the code is duplicated in multiple different spots. Love the bug fixes! I was thinking of making the same changes to the function names for reading data but felt I would be overstepping. |
Good idea. Those two bytes in front of the DEFLATE data are actually zlib header bytes. zlib itself just wraps up the DEFLATE data stream with a couple headers bytes and an adler32 checksum. So that's 2 bytes up-front for the zlib header, and 32-bit checksum at the end. The s_inflate function already handles the 32-bit checksum. Though, we should probably handle the 2 zlib bytes within a refactored s_read_zlib function (or some similar name), and hand that off to s_inflate afterwards. |
Looks like there are some linger bugs. Going to have to roll this back for now to a previous version. I had trouble parsing a variety of other aseprite files. Since the userdata chunk refactor was quite significant, I have suspicion this was the culprit. |
Thanks to @mathewmariani for the initial PR #349 on parsing tilesets. I went ahead and made some updates to their PR, including a variety of bugfixes 8ce6803.
For now tiles are stored in
ase_cel_t
just like pixels. However, there are a few open questions/todos on what to do next to make it really easy to actually use this tile information.s_color
that helps with this. Instead, we should probably provide users the tileset image itself asase_color_t
(the return value ofs_color
).The user API should look something like this (something like this should probably be in the docs as well as an example):
Where
ase_tile_t
needs to be created by answering point 1.For point 2, the tileset pixels are currently stored in
ase->tileset.data
as a void*. However, it should probably be a pointer to an array ofase_color_t
instead.The text was updated successfully, but these errors were encountered: