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