- make VideoRecorderAppState store the orginal system timer instead of just setting a NanoTimer when detaching

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9659 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent ab2c34fafb
commit cd4b513afe
  1. 5
      engine/src/desktop/com/jme3/app/state/VideoRecorderAppState.java

@ -8,6 +8,7 @@ import com.jme3.renderer.Renderer;
import com.jme3.renderer.ViewPort;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.system.NanoTimer;
import com.jme3.system.Timer;
import com.jme3.texture.FrameBuffer;
import com.jme3.util.BufferUtils;
import com.jme3.util.Screenshots;
@ -47,6 +48,7 @@ public class VideoRecorderAppState extends AbstractAppState {
private int numCpus = Runtime.getRuntime().availableProcessors();
private ViewPort lastViewPort;
private float quality;
private Timer oldTimer;
/**
* Using this constructor the video files will be written sequentially to the user's home directory with
@ -137,6 +139,7 @@ public class VideoRecorderAppState extends AbstractAppState {
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.app = app;
this.oldTimer = app.getTimer();
app.setTimer(new IsoTimer(framerate));
if (file == null) {
String filename = System.getProperty("user.home") + File.separator + "jMonkey-" + System.currentTimeMillis() / 1000 + ".avi";
@ -157,7 +160,7 @@ public class VideoRecorderAppState extends AbstractAppState {
@Override
public void cleanup() {
lastViewPort.removeProcessor(processor);
app.setTimer(new NanoTimer());
app.setTimer(oldTimer);
initialized = false;
file = null;
super.cleanup();

Loading…
Cancel
Save