Significantly improved the performance of video rendering by using the magic of multithreading
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -615,11 +615,13 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
|
||||
CameraEntity cent = ReplayHandler.getCameraEntity();
|
||||
|
||||
if(!allowMovement && !((Math.abs(cent.posX - ppl.func_148932_c()) > ReplayMod.TP_DISTANCE_LIMIT) ||
|
||||
(Math.abs(cent.posZ - ppl.func_148933_e()) > ReplayMod.TP_DISTANCE_LIMIT))) {
|
||||
return;
|
||||
} else {
|
||||
allowMovement = false;
|
||||
if(cent != null) {
|
||||
if(!allowMovement && !((Math.abs(cent.posX - ppl.func_148932_c()) > ReplayMod.TP_DISTANCE_LIMIT) ||
|
||||
(Math.abs(cent.posZ - ppl.func_148933_e()) > ReplayMod.TP_DISTANCE_LIMIT))) {
|
||||
return;
|
||||
} else {
|
||||
allowMovement = false;
|
||||
}
|
||||
}
|
||||
|
||||
Thread t = new Thread(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user