Skip to content

Improve AsepriteBinaryReader and DeflateStream usage#32

Merged
AristurtleDev merged 3 commits intoAristurtleDev:mainfrom
SaxxonPike:main
Jun 28, 2024
Merged

Improve AsepriteBinaryReader and DeflateStream usage#32
AristurtleDev merged 3 commits intoAristurtleDev:mainfrom
SaxxonPike:main

Conversation

@SaxxonPike
Copy link
Contributor

Prerequisites

  • I have verified that there are no existing pull requests that would overlap with this pull request.
  • I have verified that I am following the guidelines as outlined in this project's contribution policy
  • I Have verified that this pull request adheres to this project's code of conduct.
  • I have written a descriptive title for this pull request.
  • I have provided appropriate test coverage were applicable.

Description

Improvements to AsepriteBinaryReader

  • Instead of a heap-allocated small buffer with .AsSpan(), use stackalloc
    • In this case where the buffer is very small, stackalloc is very fast
  • Reconcile Aseprite's distinction between fixed and float:
    • Fixed point values are stored as 16:16 (that is, 16-bit integer and 16-bit fraction)
    • Floating point values are stored as single-precision IEEE values

DeflateStream to ZlibStream:

  • Instances of DeflateStream now use ZlibStream
    • We can defer the responsibility of handling the header to the .NET standard library

Non-functional changes:

  • Documentation grammar

Related Issue Ticket Numbers

  • n/a

- Aseprite docs define FIXED as 16:16 fixed point
- Aseprite docs define FLOAT as single-precision IEEE floating point
@AristurtleDev AristurtleDev merged commit 0c50ee3 into AristurtleDev:main Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants