Added Option to force load all chunks when rendering

Rewrote a lot of the Settings code
Started destroying the ReplayProcess, gonna fix that ASAP
This commit is contained in:
Marius Metzger
2015-04-06 11:00:32 +02:00
parent e7c2a462f3
commit e4d282bffe
15 changed files with 445 additions and 271 deletions

View File

@@ -27,8 +27,10 @@ public class VideoWriter {
private static final String VIDEO_EXTENSION = ".avi";
private static MovieWriter out;
private static File file;
private static boolean isRecording = false;
private static boolean requestFinish = false;
private static boolean abort = false;
private static Buffer buf;
private static int track;
@@ -52,7 +54,7 @@ public class VideoWriter {
String fileName = sdf.format(Calendar.getInstance().getTime());
File file = new File(folder, fileName+VIDEO_EXTENSION);
file = new File(folder, fileName+VIDEO_EXTENSION);
file.createNewFile();
out = Registry.getInstance().getWriter(file);
@@ -79,15 +81,20 @@ public class VideoWriter {
@Override
public void run() {
while(true) {
if(toWrite.isEmpty()) {
if(toWrite.isEmpty() || abort) {
if(requestFinish) {
requestFinish = false;
isRecording = false;
try {
out.close();
if(abort) {
file.delete();
}
} catch (IOException e) {
e.printStackTrace();
}
abort = false;
toWrite = new LinkedBlockingQueue<BufferedImage>();
return;
}
try {
@@ -132,4 +139,9 @@ public class VideoWriter {
e.printStackTrace();
}
}
public static void abortRecording() {
requestFinish = true;
abort = true;
}
}