RandyGaul / cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
4.28k stars 266 forks source link

added support to cute_aseprite.h for tilemaps and tilesets #349

Closed mathewmariani closed 1 year ago

mathewmariani commented 1 year ago

This pull request adds support for tilesets and tilemaps and may require technical guidance.

Adds a path to parse Tileset Chunk (0x2023) and various other additions to Layer Chunk (0x2004) and User Data Chunk (0x2020).

All the latest additions to User Data Chunk (0x2020) are not supported. I also opted to not add support for External Files in Tileset Chunk (0x2023) as there was no previous support for external files. But this can be added in another pull request.

RandyGaul commented 1 year ago

Wow looks incredible, do you have an ase file you can upload here so I can try it out?

mathewmariani commented 1 year ago

Yeah, it's not an impressive tilemap by any means but was enough for me to debug with.

small_tilemap.ase.zip

mathewmariani commented 1 year ago

My biggest concern is that Tileset Chunk (0x2023) offers DWORD Compressed data length but I found that using this variable would cause issues.

I was hoping you could provide technical guidance on this issue

RandyGaul commented 1 year ago

Thanks for noting! I have some time set aside to look at this in detail tomorrow

RandyGaul commented 1 year ago

I see a number of problems, and a small refactor to how udata is handled needs to be done. Also, support for external tilesets needs to be added. I'm working on all these things now.