Closed B-Reif closed 3 years ago
Regarding your questions:
We only need to support the user data chunks that are actually exposed by the UI. I can imagine users storing some meta data for custom tools in these chunks, but I expect files to only be authored by hand. So, no need to support everything that the file format theoretically allows. If someone has a specific use case that's currently not supported they'll create an issue and we go from there.
The color in user data should be an Rgba
since we're already exposing that through other parts of the API.
Ok, made some changes:
Vec<LayerData>
is now converted to LayersData
during validation.Can I close this since you created the merged PR?
This PR adds some support for parsing user data chunks and attaching them to other data.
Changes include:
UserDataContext
enum toParseInfo
, which stores some information about the most-recently parsed chunk. When parsing a UserData chunk, the context is used to attach the user data to other existing content.InternalError
case to theAsepriteParseError
enum. This would only be returned in case of some violated invariant. For now, it's only returned if theUserDataContext
holds a bad id.ParseInfo
to store layers during parsing, to support attaching user data.CelId
more.A few questions:
UserData
is an array of bytes. Since we're already exposingimage::Rgba
, should we change this field to that type?