Skip to content

Commit

Permalink
Drop the redundant camera preset name from the scene json file.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Oct 12, 2024
1 parent 31c5142 commit 26dc5d2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -2595,7 +2595,11 @@ public void setUseCustomWaterColor(boolean value) {
json.add("camera", camera.toJson());
json.add("sun", sun.toJson());
json.add("sky", sky.toJson());
json.add("cameraPresets", cameraPresets.copy());
JsonObject cameraPresets = this.cameraPresets.copy();
for (JsonMember item : cameraPresets.members) {
item.value.object().remove("name");
}
json.add("cameraPresets", cameraPresets);
JsonArray chunkList = new JsonArray();
for (ChunkPosition pos : chunks) {
JsonArray chunk = new JsonArray();
Expand Down Expand Up @@ -2923,7 +2927,11 @@ else if(waterShader.equals("SIMPLEX"))
}

if (json.get("cameraPresets").isObject()) {
cameraPresets = json.get("cameraPresets").object();
JsonObject cameraPresets = json.get("cameraPresets").object();
for (JsonMember member : cameraPresets.members) {
member.value.object().set("name", new JsonString(member.name));
}
this.cameraPresets = cameraPresets;
}

// Current SPP and render time are read after loading
Expand Down

0 comments on commit 26dc5d2

Please sign in to comment.