From 668e59f52d8be0bf257e05399376c8913b51a5f7 Mon Sep 17 00:00:00 2001 From: Caspian Rychlik-Prince Date: Tue, 7 Dec 2004 00:23:20 +0000 Subject: [PATCH] Shoved resolution down into ints for better wrap handling --- src/java/org/lwjgl/util/Timer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/org/lwjgl/util/Timer.java b/src/java/org/lwjgl/util/Timer.java index 4370ebcc..32705875 100644 --- a/src/java/org/lwjgl/util/Timer.java +++ b/src/java/org/lwjgl/util/Timer.java @@ -54,13 +54,13 @@ public class Timer { private static int queryCount = 0; // Globally keeps track of time for all instances of Timer - private static long currentTime; + private static int currentTime; // When the timer was started - private long startTime; + private int startTime; // The last time recorded by getTime() - private long lastTime; + private int lastTime; // Whether the timer is paused private boolean paused; @@ -133,7 +133,7 @@ public class Timer { * @param newTime the new time, in seconds */ public void set(float newTime) { - long newTimeInTicks = (long) ((double) newTime * (double) resolution); + int newTimeInTicks = (int) ((double) newTime * (double) resolution); startTime = currentTime - newTimeInTicks; lastTime = newTimeInTicks; } @@ -144,7 +144,7 @@ public class Timer { * from it. */ public static void tick() { - currentTime = Sys.getTime(); + currentTime = (int) Sys.getTime(); // Periodically refresh the timer resolution: queryCount ++;