From 1590adce0f10a7d5ef49c9f4450be7fd6d3d5a54 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 13 Apr 2019 04:25:54 -0700 Subject: [PATCH] Fixes issue with draw fps text --- core/src/com/riiablo/Client.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/com/riiablo/Client.java b/core/src/com/riiablo/Client.java index aa046f1a..1cec040a 100644 --- a/core/src/com/riiablo/Client.java +++ b/core/src/com/riiablo/Client.java @@ -21,10 +21,10 @@ import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.I18NBundle; -import com.badlogic.gdx.utils.Pools; import com.badlogic.gdx.utils.Scaling; import com.badlogic.gdx.utils.SnapshotArray; import com.badlogic.gdx.utils.viewport.ExtendViewport; @@ -117,6 +117,8 @@ public class Client extends Game { private boolean forceDrawFps; private byte drawFpsMethod; + private final GlyphLayout fps = new GlyphLayout(); + private String realm; public Client(FileHandle home) { @@ -434,8 +436,7 @@ public class Client extends Game { BitmapFont font = console.getFont(); if (font == null) return; - GlyphLayout fps = Pools.obtain(GlyphLayout.class); - fps.setText(font, Integer.toString(Gdx.graphics.getFramesPerSecond())); + fps.setText(font, Integer.toString(Gdx.graphics.getFramesPerSecond()), Color.WHITE, 0, Align.left, false); int drawFpsMethod = this.drawFpsMethod; if (forceDrawFps && drawFpsMethod == 0) { drawFpsMethod = 1; @@ -465,7 +466,6 @@ public class Client extends Game { } font.draw(b, fps, x, y); - Pools.free(fps); } @Override