-
Notifications
You must be signed in to change notification settings - Fork 7
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
Generate Pixmap on Sprite::new #73
Conversation
@flother hi, a friendly ping - let me know if anything else is needed here and in other PRs. Thanks!! |
Sorry for the radio silence. The free time I have to spend on open-source tends to come in waves, all dependent on what life throws at me. I hope I'll have some time in the coming week to take a look at the open PRs here |
Looks like merging #72 has caused a trivial conflict. Could you take a quick look? |
fixed |
More conflicts now #71 has been merged (sorry, should have waited on that before asking you to resolve the earlier conflicts) |
This is a partial simplification from the other PR, without any breaking changes.
I am NOT certain if this is correct logically - please take a look: Currently, sprites are iterated by key, so it goes in sorted order (due to it being a `BTreeMap`). I changed it to iteration over pixmaps - so now `items` have a different order. It seems to be ok, because the `pack_into_po2` seem to resort them according to the largest first anyway, but I am not as familiar with the algo. Also, a minor code de-duplication and spelling fix
Make Sprite a readonly struct, with the Pixmap loading on creation.
fixed |
Thanks! |
Do not merge until #72 is merged - this PR includes code from that
Make Sprite a readonly struct, with the Pixmap loading on creation.
This paves a way for simpler and quicker sprites because Sprite is now guaranteed to be valid if passed anywhere.
Also, I suspect the
make_unique
can be simplified to use Pixmap values instead of converting them temporarily into PNGs