Sprite RAM "rotation" within the same RAM #2416
Unanswered
pjmi1
asked this question in
Q&A - Sprites
Replies: 1 comment 1 reply
-
I get the idea. It would cause problems for 4bpp and 1bpp sprites since each line may be padded, hence required RAM allocation may be different if width and height are swapped. So this would have constraint implications which is messy. It sounds like there is not enough usable RAM left in your application once a large sprite is defined. In this case probloems are likely to recur. If your board has PSRAM then enable it and the sprite class will automatically use it, then these memory problems will be solved. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
This is difficult to explain without being misunderstood...
Please would it possible to have a new function which is equivalent to deleteSprite() followed by createSprite(), using new width & height dimensions but not reallocating the RAM - since the RAM required is the same for when width*depth is the same.
For instance: recreateSprite( oldspritePtr, newwidth, newheight)
I use a large full screen sprite as a framebuffer to render the display and need to change the entire display orientation on the fly (in steps of 90 degrees). The library needs to know the dimensions have changed - it's not the same as just rotating the sprite because eg the text plot width changes.
Until now I have succesfully used deleteSprite() then createSprite(with height/width swapped) but on my ESP32 things go wrong now - the createSprite() seems to not simply re-use that same RAM freed from the deleteSprite() even though it is exactly the same size - the callocSprite can't find enough RAM required for the replacement sprite.
The recreateSprite() system could be enhanced further by allowing any sprite size changes if the RAM required is <= the original size allocated by the createSprite().
Beta Was this translation helpful? Give feedback.
All reactions