changeset 73:877ae4b2993c tip

merge laptop changes.
author Robert McIntyre <rlm@mit.edu>
date Mon, 10 Mar 2014 18:58:08 -0400
parents dd97f65f940c (current diff) a67aef438383 (diff)
children
files
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/src/com/aurellem/capture/IsoTimer.java	Mon Mar 10 18:57:00 2014 -0400
     1.2 +++ b/src/com/aurellem/capture/IsoTimer.java	Mon Mar 10 18:58:08 2014 -0400
     1.3 @@ -45,19 +45,19 @@
     1.4  	}
     1.5  
     1.6  	public long getTime() {
     1.7 -		return this.ticks;
     1.8 +		return ticks;
     1.9  	}
    1.10  
    1.11  	public long getResolution() {
    1.12 -		return (long) framerate;
    1.13 +		return framerate;
    1.14  	}
    1.15  
    1.16  	public float getFrameRate() {
    1.17 -		return this.framerate;
    1.18 +		return framerate;
    1.19  	}
    1.20  
    1.21  	public float getTimePerFrame() {
    1.22 -		return (float) (1.0f / this.framerate);
    1.23 +		return (float) (1.0f / framerate);
    1.24  	}
    1.25  
    1.26  	public void update() {this.ticks++;}
     2.1 --- a/src/com/aurellem/capture/RatchetTimer.java	Mon Mar 10 18:57:00 2014 -0400
     2.2 +++ b/src/com/aurellem/capture/RatchetTimer.java	Mon Mar 10 18:58:08 2014 -0400
     2.3 @@ -11,12 +11,12 @@
     2.4   */
     2.5  
     2.6  public class RatchetTimer extends Timer{
     2.7 -	private float framerate;
     2.8 +    private long framerate;
     2.9      private int ticks;
    2.10      private long lastTime = 0;
    2.11  
    2.12      public RatchetTimer(float framerate) {
    2.13 -        this.framerate = framerate;
    2.14 +        this.framerate = (long) framerate;
    2.15          this.ticks = 0;
    2.16      }
    2.17      
    2.18 @@ -24,19 +24,19 @@
    2.19       * return time in milliseconds
    2.20       */
    2.21      public long getTime() {
    2.22 -        return (long) (this.ticks * (1.0f / this.framerate) * 1000f);
    2.23 +	return ticks;
    2.24      }
    2.25  
    2.26      public long getResolution() {
    2.27 -        return 1000000000L;
    2.28 +	return framerate;
    2.29      }
    2.30  
    2.31      public float getFrameRate() {
    2.32 -        return this.framerate;
    2.33 +        return framerate;
    2.34      }
    2.35  
    2.36      public float getTimePerFrame() {
    2.37 -        return (float) (1.0f / this.framerate);
    2.38 +        return (float) (1.0f / framerate);
    2.39      }
    2.40  
    2.41      public void update() {