Skip to content

Commit

Permalink
MobilePlatform: Only smooth text on the fps counter.
Browse files Browse the repository at this point in the history
  • Loading branch information
AShiningRay committed Feb 20, 2025
1 parent 46ac489 commit bcf0ce7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/org/recompile/mobile/MobilePlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,12 @@ private void limitFps()
}

// For now, the logic here works by updating the framerate counter every second
private final void showFPS() {
private final void showFPS()
{
frameCount++;

if (System.nanoTime() - lastFpsTime >= 1_000_000_000) {
if (System.nanoTime() - lastFpsTime >= 1_000_000_000)
{
fps = frameCount;
frameCount = 0;
lastFpsTime = System.nanoTime();
Expand All @@ -390,7 +392,7 @@ private final void showFPS() {
Graphics2D overlayGraphics = overlayImage.createGraphics();

// Enable font AA for better text quality (GASP uses font resource information to apply AA when appropriate)
gc.getGraphics2D().setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
gc.getGraphics2D().setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
gc.getGraphics2D().setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);

// Set the overlay background
Expand Down

0 comments on commit bcf0ce7

Please sign in to comment.