Skip to content

Commit

Permalink
lcdui: Canvas: Only do serviceRepaints if not painting the screen
Browse files Browse the repository at this point in the history
Minor mistake here, as it would immediately return if a paint
call was NOT underway. It should only return immediately if there
IS a paint underway, or if the canvas is not being shown.

Fixes the Panasonic VS3 version of Sonic 1. Related to #10.
  • Loading branch information
AShiningRay committed Mar 3, 2025
1 parent 3d83962 commit 20f808a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/javax/microedition/lcdui/Canvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void repaint(int x, int y, int width, int height)
public void serviceRepaints()
{
// TODO: Flesh this out properly, some games might need it.
if(!isShown() || !isPainting) { return; }
if(!isShown() || isPainting) { return; }

// Right now all this does is force a redraw, no queue consideration is made.
Mobile.getPlatform().flushGraphics(platformImage, 0, 0, width, height);
Expand Down

0 comments on commit 20f808a

Please sign in to comment.