aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRenderer.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index 73a3be2..75ce575 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -18,10 +18,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Queue;
import java.util.Set;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
import org.lwjgl.BufferUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@@ -44,7 +41,6 @@ import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
-import net.minecraftforge.event.world.ChunkEvent;
/** The main renderer class. */
public class NeoRenderer {
@@ -170,18 +166,17 @@ public class NeoRenderer {
}
}
- private static int[] renderedMeshesReturn = new int[1];
- private static int[] renderedQuadsReturn = new int[1];
-
private void initIndexBuffers() {
for(int i = 0; i < 2; i++) {
piFirst[i].limit(MAX_MESHES);
piCount[i].limit(MAX_MESHES);
for(Mesh mesh : sentMeshes[i]) {
if(mesh.visible && (Config.maxMeshesPerFrame == -1 || renderedMeshes < Config.maxMeshesPerFrame)) {
- mesh.writeToIndexBuffer(piFirst[i], piCount[i], renderedMeshesReturn, renderedQuadsReturn, interpXDiv, interpYDiv, interpZDiv);
- renderedMeshes += renderedMeshesReturn[0];
- renderedQuads += renderedQuadsReturn[0];
+ int meshes = mesh.writeToIndexBuffer(piFirst[i], piCount[i], interpXDiv, interpYDiv, interpZDiv);
+ renderedMeshes += meshes;
+ for(int j = piCount[i].position() - meshes; j < piCount[i].position(); j++) {
+ renderedQuads += piCount[i].get(j) / 4;
+ }
}
}
piFirst[i].flip();