aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer/LODRenderer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/LODRenderer.java')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index eb4dc45..8bfe85d 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -387,7 +387,8 @@ public class LODRenderer {
int y = Math.floorDiv(wr.posY, 16);
setMeshVisible(lodChunk.chunkMeshes[y * 2 + 0], false);
setMeshVisible(lodChunk.chunkMeshes[y * 2 + 1], false);
- setMeshVisible(lodChunk.simpleMesh, false);
+ setMeshVisible(lodChunk.simpleMeshes[0], false);
+ setMeshVisible(lodChunk.simpleMeshes[1], false);
}
public void onDontDraw(WorldRenderer wr) {
@@ -469,7 +470,7 @@ public class LODRenderer {
}
private void sendChunkToGPU(LODChunk lodChunk) {
- lodChunk.putSimpleMesh(new SimpleChunkMesh(lodChunk.chunk));
+ lodChunk.putSimpleMeshes(SimpleChunkMesh.generateSimpleMeshes(lodChunk.chunk));
Entity player = (Entity) Minecraft.getMinecraft().getIntegratedServer().getConfigurationManager().playerEntityList.get(0);
@@ -497,16 +498,18 @@ public class LODRenderer {
public void lodChunkChanged(LODChunk lodChunk) {
int newLOD = (!lodChunk.hasChunkMeshes() && lodChunk.lod == 2) ? 1 : lodChunk.lod;
- if(lodChunk.simpleMesh != null) {
- if(lodChunk.visible && newLOD == 1) {
- if(!lodChunk.simpleMesh.visible) {
- setMeshVisible(lodChunk.simpleMesh, true);
- }
- } else {
- if(lodChunk.simpleMesh.visible) {
- setMeshVisible(lodChunk.simpleMesh, false);
- }
- }
+ for(SimpleChunkMesh sm : lodChunk.simpleMeshes) {
+ if(sm != null) {
+ if(lodChunk.visible && newLOD == 1) {
+ if(!sm.visible) {
+ setMeshVisible(sm, true);
+ }
+ } else {
+ if(sm.visible) {
+ setMeshVisible(sm, false);
+ }
+ }
+ }
}
for(ChunkMesh cm : lodChunk.chunkMeshes) {
if(cm != null) {