Fix adj sections rendering quad merge bug

This commit is contained in:
TomTheFurry
2022-09-09 14:37:03 +08:00
parent 1dadf056da
commit 1b0c97ffca
3 changed files with 4 additions and 9 deletions
@@ -30,7 +30,6 @@ import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicReference;
public class ColumnRenderSource implements LodRenderSource, IColumnDatatype {
@@ -280,8 +279,8 @@ public class ColumnRenderSource implements LodRenderSource, IColumnDatatype {
ColumnRenderSource[] data = new ColumnRenderSource[ELodDirection.ADJ_DIRECTIONS.length];
for (ELodDirection direction : ELodDirection.ADJ_DIRECTIONS) {
LodRenderSection section = quadTree.getSection(sectionPos.getAdjacent(direction)); //FIXME: Handle traveling through different detail levels
if (section != null && section.getRenderContainer() != null && section.getRenderContainer() instanceof ColumnRenderBuffer) {
data[direction.ordinal()-2] = ((ColumnRenderSource) section.getRenderContainer());
if (section != null && section.getRenderSource() != null && section.getRenderSource() instanceof ColumnRenderSource) {
data[direction.ordinal()-2] = ((ColumnRenderSource) section.getRenderSource());
}
}
inBuildRenderBuffer = ColumnRenderBuffer.build(level, usedBufferOpaque, usedBufferTransparent, this, data);
@@ -102,7 +102,7 @@ public class LodRenderSection {
return lodRenderSource != null && !lodRenderSource.isValid();
}
public LodRenderSource getRenderContainer() {
public LodRenderSource getRenderSource() {
return lodRenderSource;
}
@@ -1,15 +1,11 @@
package com.seibel.lod.core.a7.render;
import com.seibel.lod.core.a7.datatype.LodRenderSource;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonInjector;
import com.seibel.lod.core.objects.DHBlockPos;
import com.seibel.lod.core.objects.Pos2D;
import com.seibel.lod.core.a7.pos.DhSectionPos;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.util.gridList.MovableGridRingList;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
import java.util.Comparator;
import java.util.concurrent.atomic.AtomicReference;
public class RenderBufferHandler {
@@ -73,7 +69,7 @@ public class RenderBufferHandler {
// If this fails, there may be concurrent modification of the quad tree
// (as this update() should be called from the same thread that calls update() on the quad tree)
LodUtil.assertTrue(section != null);
LodRenderSource container = section.getRenderContainer();
LodRenderSource container = section.getRenderSource();
// Update self's render buffer state
boolean shouldRender = section.canRender();