|
|
@ -130,23 +130,23 @@ public class Renderer extends Backended {
|
|
|
|
public static void init() {
|
|
|
|
public static void init() {
|
|
|
|
instance = new Renderer();
|
|
|
|
instance = new Renderer();
|
|
|
|
instance.depthTest();
|
|
|
|
instance.depthTest();
|
|
|
|
for(int i = 0; i < 1; i++) {
|
|
|
|
// for(int i = 0; i < 1; i++) {
|
|
|
|
Thread worker = new Thread(() -> {
|
|
|
|
// Thread worker = new Thread(() -> {
|
|
|
|
while (true) {
|
|
|
|
// while (true) {
|
|
|
|
beginPerf("worldgen");
|
|
|
|
// beginPerf("worldgen");
|
|
|
|
worldGenUpdate();
|
|
|
|
// worldGenUpdate();
|
|
|
|
long taken = endPerf("worldgen") / 1000000;
|
|
|
|
// long taken = endPerf("worldgen") / 1000000;
|
|
|
|
long max = 8;
|
|
|
|
// long max = 8;
|
|
|
|
long toSleep = Math.max(max - taken, 0);
|
|
|
|
// long toSleep = Math.max(max - taken, 0);
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
Thread.sleep(toSleep);
|
|
|
|
// Thread.sleep(toSleep);
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
// } catch (InterruptedException e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
// throw new RuntimeException(e);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}, "WorldGen worker "+i);
|
|
|
|
// }, "WorldGen worker "+i);
|
|
|
|
worldGenWorkers.add(worker);
|
|
|
|
// worldGenWorkers.add(worker);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
crosshair = new IndexedMesh();
|
|
|
|
crosshair = new IndexedMesh();
|
|
|
|
crosshair.init();
|
|
|
|
crosshair.init();
|
|
|
|
Window win = Screen.get(Windows.MAIN.toString());
|
|
|
|
Window win = Screen.get(Windows.MAIN.toString());
|
|
|
@ -330,6 +330,9 @@ public class Renderer extends Backended {
|
|
|
|
beginPerf("delete");
|
|
|
|
beginPerf("delete");
|
|
|
|
deleteUpdate();
|
|
|
|
deleteUpdate();
|
|
|
|
endPerf("delete");
|
|
|
|
endPerf("delete");
|
|
|
|
|
|
|
|
beginPerf("worldgen");
|
|
|
|
|
|
|
|
worldGenUpdate();
|
|
|
|
|
|
|
|
endPerf("worldgen");
|
|
|
|
beginPerf("mesh");
|
|
|
|
beginPerf("mesh");
|
|
|
|
meshUpdate();
|
|
|
|
meshUpdate();
|
|
|
|
endPerf("mesh");
|
|
|
|
endPerf("mesh");
|
|
|
|