Have CalibratingTimer remember the largest drift it's seen, and let us get at that
via our FrameManager. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@439 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -22,34 +22,21 @@
|
||||
package com.threerings.media;
|
||||
|
||||
import java.applet.Applet;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.KeyEventDispatcher;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
|
||||
import javax.swing.JLayeredPane;
|
||||
import javax.swing.RepaintManager;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.event.AncestorEvent;
|
||||
import javax.swing.event.AncestorListener;
|
||||
import javax.swing.RepaintManager;
|
||||
|
||||
import com.samskivert.swing.RuntimeAdjust;
|
||||
import com.samskivert.util.ListUtil;
|
||||
import com.samskivert.util.RunAnywhere;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.media.timer.CalibratingTimer;
|
||||
import com.threerings.media.timer.MediaTimer;
|
||||
import com.threerings.media.timer.MillisTimer;
|
||||
import com.threerings.media.util.TrailingAverage;
|
||||
@@ -216,6 +203,19 @@ public abstract class FrameManager
|
||||
{
|
||||
return _timer.getElapsedMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the highest drift ratio our timer has seen. 1.0 means no drift (and is what we return
|
||||
* if we're not using a CalibratingTimer)
|
||||
*/
|
||||
public double getMaxTimerDriftRatio ()
|
||||
{
|
||||
if (_timer instanceof CalibratingTimer) {
|
||||
return ((CalibratingTimer)_timer).getMaxDriftRatio();
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an overlay that can be used to render sprites and animations on top of the entire
|
||||
|
||||
Reference in New Issue
Block a user