Replies: 1 comment 1 reply
-
My plan would be to allocate using a list of free indices into Rcs which objects hold if they're using the matrix. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I made a PR #363 , which was understandably not merged because it is desirable to track the affine matrix resources automatically rather than the user keeping track.
I know you said that you were going to implement this in a later release, I was wondering if you might let me have a stab at it if possible!
So looking at what's needed, I was imagining that affine matrices are created in the standard way then passed to the object controller, which inserts it into shadow OAM, and returns a handle which is a smart pointer which will deallocate the affine matrix when it leaves scope. You can then set this matrix on a sprite, which will consume it and would require an extra field on the sprite to store this optional ref.
Internally, the shadow OAM would have an arena style allocation method for allocating the affine sprites:
The matrix entry type would be a union:
This scheme would not allow duplicate affine matrices, so if you wanted to share an affine matrix between 2 sprites say, you would use an
Rc
.Does this sound like a good/feasible idea?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions