aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-07-11 23:05:53 +0200
committermakamys <makamys@outlook.com>2022-07-11 23:05:53 +0200
commit8eb350325f025ac0b3cb9e33505ee18c2b23a282 (patch)
tree47f68f4fc7264e1feb113021d990c62e88c34124 /src
parentacdc0adecd3c8d649cad97c6932fb7ba418721e6 (diff)
downloadNeodymium-8eb350325f025ac0b3cb9e33505ee18c2b23a282.tar.gz
Neodymium-8eb350325f025ac0b3cb9e33505ee18c2b23a282.tar.bz2
Neodymium-8eb350325f025ac0b3cb9e33505ee18c2b23a282.zip
Improve error logging
Diffstat (limited to 'src')
-rw-r--r--src/main/java/makamys/neodymium/renderer/ChunkMesh.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
index a574765..e284da3 100644
--- a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
+++ b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
@@ -81,15 +81,21 @@ public class ChunkMesh extends Mesh {
// Sometimes the tessellator has no vertices and weird flags. Don't warn in this case, just silently return.
return;
}
+ boolean errors = false;
if(t.vertexCount % 4 != 0) {
- LOGGER.error("Error: Vertex count is not a multiple of 4");
- return;
+ LOGGER.error("Error in chunk " + tessellatorToString(t) + ": Vertex count is not a multiple of 4");
+ errors = true;
}
if(t.drawMode != GL11.GL_QUADS) {
- LOGGER.error("Error: Unsupported draw mode: " + t.drawMode);
+ LOGGER.error("Error in chunk " + tessellatorToString(t) + ": Unsupported draw mode: " + t.drawMode);
+ errors = true;
}
if(!t.hasTexture || !t.hasBrightness || !t.hasColor || t.hasNormals) {
- LOGGER.error("Error: Unsupported tessellator flags");
+ LOGGER.error("Error in chunk " + tessellatorToString(t) + ": Unsupported tessellator flags");
+ errors = true;
+ }
+ if(errors) {
+ LOGGER.error("Skipping chunk due to errors.");
return;
}
@@ -98,6 +104,10 @@ public class ChunkMesh extends Mesh {
}
}
+ private static String tessellatorToString(Tessellator t) {
+ return "(" + t.xOffset + ", " + t.yOffset + ", " + t.zOffset + ")";
+ }
+
public void finishConstruction() {
List<MeshQuad> quads = quadBuf.getAsList();