Significantly improved the performance of video rendering by using the magic of multithreading

This commit is contained in:
Marius Metzger
2015-04-05 02:10:44 +02:00
parent 9df94fd789
commit e7c2a462f3
5 changed files with 22 additions and 12 deletions

View File

@@ -63,6 +63,8 @@ public class ReplayProcess {
return;
}
blocked = deepBlock = false;
startRealTime = System.currentTimeMillis();
lastRealTime = startRealTime;
lastRealReplayTime = 0;
@@ -110,7 +112,6 @@ public class ReplayProcess {
if(!deepBlock) blocked = false;
if(!blocked || !isVideoRecording())
ReplayProcess.tickReplay();
else System.out.println("nope");
}
public static void tickReplay() {
@@ -272,7 +273,9 @@ public class ReplayProcess {
curPos = timeLinear.getPoint(Math.max(0, Math.min(1, timePos)));
}
if(pos != null) ReplayHandler.getCameraEntity().movePath(pos);
if(pos != null) {
ReplayHandler.getCameraEntity().movePath(pos);
}
ReplayHandler.setSpeed(curSpeed);
@@ -288,7 +291,6 @@ public class ReplayProcess {
lastRealReplayTime = curRealReplayTime;
lastRealTime = curTime;
//Video capturing, for testing purposes
if(isVideoRecording()) {
try {
if(!VideoWriter.isRecording() && ReplayHandler.isInPath()) {