-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
What could be improved
The Region class should be immutable and all redundant fields in TexturePackerSprite should be removed. WIP: perf/immutable_region_data
https://github.com/gnarhard/flame/tree/perf/immutable_region_data
This _parse method is also not the friendliest to read. I think there could be some improvement there too.
Why should this be improved
I've already confirmed that this will reduce TexturePackerSprite memory consumption by ~50%. These fields that are in the TexturePackerSprite class that I've removed are redundant and already stored in the region data. My branch removes all of that code that shouldn't be mutated anyways, and makes Region immutable. However, I'm hung up on the tests and need help here.
_parse method could be improved to be easier to read and maintain.
Risks
This will be a breaking change. Currently, I don't have access to the texture pack files in the testing environment. Each field needs to be set every time, but since I don't have access to the texture pack save files, I can't check and see which algorithm is being used to update the atlas files accordingly.
More information
No response
Other
- Are you interested in working on a PR for this?