Skip to content

Commit

Permalink
MobilePlatform: Rename the displayable variable for more clarity
Browse files Browse the repository at this point in the history
"d" is a bit too obscure, and is harder to search for as well
  • Loading branch information
AShiningRay committed Nov 19, 2024
1 parent e5dc2ef commit 9fd2b17
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/org/recompile/mobile/MobilePlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class MobilePlatform

public MIDletLoader loader;
private EventQueue eventQueue;
private Displayable d;
public static Displayable displayable;

public Runnable painter;

Expand Down Expand Up @@ -112,6 +112,7 @@ public void resizeLCD(int width, int height)

lcd = new PlatformImage(width, height);
gc = lcd.getGraphics();

}

public BufferedImage getLCD() { return lcd.getCanvas(); }
Expand Down Expand Up @@ -152,33 +153,33 @@ public void pointerReleased(int x, int y)
public void doKeyPressed(int keycode)
{
updateKeyState(keycode, 1);
if ((d = Mobile.getDisplay().getCurrent()) != null) { d.keyPressed(keycode); }
if ((displayable = Mobile.getDisplay().getCurrent()) != null) { displayable.keyPressed(keycode); }
}

public void doKeyReleased(int keycode)
{
updateKeyState(keycode, 0);
if ((d = Mobile.getDisplay().getCurrent()) != null) { d.keyReleased(keycode); }
if ((displayable = Mobile.getDisplay().getCurrent()) != null) { displayable.keyReleased(keycode); }
}

public void doKeyRepeated(int keycode)
{
if ((d = Mobile.getDisplay().getCurrent()) != null) { d.keyRepeated(keycode); }
if ((displayable = Mobile.getDisplay().getCurrent()) != null) { displayable.keyRepeated(keycode); }
}

public void doPointerDragged(int x, int y)
{
if ((d = Mobile.getDisplay().getCurrent()) != null) { d.pointerDragged(x, y); }
if ((displayable = Mobile.getDisplay().getCurrent()) != null) { displayable.pointerDragged(x, y); }
}

public void doPointerPressed(int x, int y)
{
if ((d = Mobile.getDisplay().getCurrent()) != null) { d.pointerPressed(x, y); }
if ((displayable = Mobile.getDisplay().getCurrent()) != null) { displayable.pointerPressed(x, y); }
}

public void doPointerReleased(int x, int y)
{
if ((d = Mobile.getDisplay().getCurrent()) != null) { d.pointerReleased(x, y); }
if ((displayable = Mobile.getDisplay().getCurrent()) != null) { displayable.pointerReleased(x, y); }
}

private void updateKeyState(int key, int val)
Expand Down

0 comments on commit 9fd2b17

Please sign in to comment.