Change the way debug info is shown

pull/12/head
Caroline Bell 2020-03-02 02:36:19 -08:00
parent f22076fe44
commit 95d4f19ad4
2 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ public class IngameHUD extends Screen
{ {
debugText = ginger3D.registerText("Loading...", 2, new Vector2f(0, 0), 1f, true, "debugInfo"); debugText = ginger3D.registerText("Loading...", 2, new Vector2f(0, 0), 1f, true, "debugInfo");
debugText.setBorderWidth(0.5f); debugText.setBorderWidth(0.5f);
positionText = ginger3D.registerText("Loading...", 2, new Vector2f(0, -0.1f), 1f, true, "debugInfo"); positionText = ginger3D.registerText("Loading...", 2, new Vector2f(0, -0.1f), 1f, true, "posInfo");
positionText.setBorderWidth(0.5f); positionText.setBorderWidth(0.5f);
} }
@ -35,11 +35,11 @@ public class IngameHUD extends Screen
// long maxMemory = Runtime.getRuntime().maxMemory(); // long maxMemory = Runtime.getRuntime().maxMemory();
long totalMemory = Runtime.getRuntime().totalMemory(); long totalMemory = Runtime.getRuntime().totalMemory();
long freeMemory = Runtime.getRuntime().freeMemory(); long freeMemory = Runtime.getRuntime().freeMemory();
long usedMemory = totalMemory - freeMemory; long usedMemory = (totalMemory - freeMemory) / 1024 / 1024;
Vector4i dbg = litecraft.dbgStats; Vector4i dbg = litecraft.dbgStats;
Vector3f position = GingerRegister.getInstance().game.data.player.getPosition(); Vector3f position = GingerRegister.getInstance().game.data.player.getPosition();
debugText.setText("FPS: " + dbg.x() + " UPS: " + dbg.y + " TPS: " + dbg.z + " Mem: " + (usedMemory / 1024 / 1024) + "MB / " + (totalMemory / 1024 / 1024) + " MB"); debugText.setText("FPS: " + dbg.x() + " UPS: " + dbg.y() + " TPS: " + dbg.z() + " TWL: " + dbg.w() + " Mem: " + usedMemory + "MB");
positionText.setText("Position " + (int) position.x() + ", " + (int) position.y() + ", "+ (int) position.z() ); positionText.setText("Position: " + (int) position.x() + ", " + (int) position.y() + ", "+ (int) position.z() );
} }
@Override @Override

View File

@ -41,7 +41,7 @@ public class TitleScreen extends Screen
public void tick() public void tick()
{ {
Vector4i dbg = litecraft.dbgStats; Vector4i dbg = litecraft.dbgStats;
debugText.setText("FPS: " + dbg.x() + " UPS: " + dbg.y + " TPS: " + dbg.z); debugText.setText("FPS: " + dbg.x() + " UPS: " + dbg.y() + " TPS: " + dbg.z() + " TWL: " + dbg.w());
playButton.update(); playButton.update();
if (playButton.isClicked()) if (playButton.isClicked())
{ {
@ -49,7 +49,7 @@ public class TitleScreen extends Screen
if (Litecraft.getInstance().getWorld() == null) if (Litecraft.getInstance().getWorld() == null)
{ {
Litecraft.getInstance().setSave(new LitecraftSave("cegregatedordinaldata", false)); Litecraft.getInstance().setSave(new LitecraftSave("SegregatedOrdinalData", false));
Litecraft.getInstance().changeWorld(Litecraft.getInstance().getSave().getWorldOrCreate(Dimensions.OVERWORLD)); Litecraft.getInstance().changeWorld(Litecraft.getInstance().getSave().getWorldOrCreate(Dimensions.OVERWORLD));
ginger3D.setGingerPlayer(Litecraft.getInstance().getWorld().player); ginger3D.setGingerPlayer(Litecraft.getInstance().getWorld().player);
} }