diff src/com/aurellem/capture/RatchetTimer.java @ 73:877ae4b2993c tip

merge laptop changes.
author Robert McIntyre <rlm@mit.edu>
date Mon, 10 Mar 2014 18:58:08 -0400
parents ddb300c5335f
children
line wrap: on
line diff
     1.1 --- a/src/com/aurellem/capture/RatchetTimer.java	Mon Mar 10 18:57:00 2014 -0400
     1.2 +++ b/src/com/aurellem/capture/RatchetTimer.java	Mon Mar 10 18:58:08 2014 -0400
     1.3 @@ -11,12 +11,12 @@
     1.4   */
     1.5  
     1.6  public class RatchetTimer extends Timer{
     1.7 -	private float framerate;
     1.8 +    private long framerate;
     1.9      private int ticks;
    1.10      private long lastTime = 0;
    1.11  
    1.12      public RatchetTimer(float framerate) {
    1.13 -        this.framerate = framerate;
    1.14 +        this.framerate = (long) framerate;
    1.15          this.ticks = 0;
    1.16      }
    1.17      
    1.18 @@ -24,19 +24,19 @@
    1.19       * return time in milliseconds
    1.20       */
    1.21      public long getTime() {
    1.22 -        return (long) (this.ticks * (1.0f / this.framerate) * 1000f);
    1.23 +	return ticks;
    1.24      }
    1.25  
    1.26      public long getResolution() {
    1.27 -        return 1000000000L;
    1.28 +	return framerate;
    1.29      }
    1.30  
    1.31      public float getFrameRate() {
    1.32 -        return this.framerate;
    1.33 +        return framerate;
    1.34      }
    1.35  
    1.36      public float getTimePerFrame() {
    1.37 -        return (float) (1.0f / this.framerate);
    1.38 +        return (float) (1.0f / framerate);
    1.39      }
    1.40  
    1.41      public void update() {