Changes

SMIDP2lib for SDCC

775 bytes added, 15:38, 20 December 2011
=== Double-buffering makes it problematic to "un-draw" ===
sMIDP2lib_bufferscreen.getRGB() to store the piece of background you're about to draw on, in order to be able to redraw the background in next frame. Let's say the sprite is about to be drawn at (10,0) and it's a 16x16 pixels bit sprite. Then before drawing the sprite, you would call sMIDP2lib_bufferscreen.getRGB() to save the 16x16 pixels piece of background, and then draw the sprite and then call flushGraphics().
Next frame, you will then want to draw that piece of the background again to cover our sprite before drawing the sprite in the next location. But since we switched buffer-screen with the flushGraphics(), we are now drawing on another screen where our sprite is actually placed on another location. Therefor we will most likely not be deleting it properly.
I don't have any ideas on how to solve this at the moment, other that either skipping the double-buffering part, or breaking the MIDP2.0 API rules. But I hope we'll find a solution.