From 4c86b17807e72c29363ca228ef7fca0c3c6953fd Mon Sep 17 00:00:00 2001 From: Recrown Date: Fri, 24 Nov 2017 17:32:28 -0600 Subject: [PATCH] added some debug information in options page --- .../graphics/ui/pages/OptionsPage.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/OptionsPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/OptionsPage.java index cb9b92d..14e84e8 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/OptionsPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/OptionsPage.java @@ -156,6 +156,34 @@ public class OptionsPage extends Page { return super.keyUp(event, keycode); } }); + + optionsTable.row(); + + Label fpsLabel = new Label("", core.getDefaultSkin()) { + @Override + public void act(float delta) { + setText("Current Frames Per Second: " + Gdx.graphics.getFramesPerSecond()); + super.act(delta); + } + }; + optionsTable.add(fpsLabel).colspan(2); + + optionsTable.row(); + + Label usageLabel = new Label("Current usage (lower the better): " + 100f*((float)(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/(float)Runtime.getRuntime().totalMemory()) + "%", core.getDefaultSkin()) { + float refreshTime = 60; + @Override + public void act(float delta) { + refreshTime -= delta; + if (refreshTime <= 0) { + refreshTime = 60; + setText("Current usage (lower the better): " + 100f*((float)(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/(float)Runtime.getRuntime().totalMemory()) + "%"); + } + super.act(delta); + } + }; + + optionsTable.add(usageLabel).colspan(2); } public void saveOptions(Preferences prefs) {