diff --git a/src/main/java/com/seibel/lod/util/DataPointUtil.java b/src/main/java/com/seibel/lod/util/DataPointUtil.java index 5dc8e597c..09826b5a8 100644 --- a/src/main/java/com/seibel/lod/util/DataPointUtil.java +++ b/src/main/java/com/seibel/lod/util/DataPointUtil.java @@ -278,7 +278,6 @@ public class DataPointUtil public static long[] mergeMultiData(long[][] dataToMerge) { - //new code short[] projection = ThreadMapUtil.getProjectionShort((WORLD_HEIGHT + 1) / 16); short[][] heightAndDepth = ThreadMapUtil.getHeightAndDepth((WORLD_HEIGHT / 2) + 1); long[] singleDataToMerge = ThreadMapUtil.getSingleAddDataToMerge(dataToMerge.length); @@ -314,7 +313,6 @@ public class DataPointUtil } } - //We check if there is any data that's not empty or void if (allEmpty) return new long[]{EMPTY_DATA}; @@ -357,74 +355,6 @@ public class DataPointUtil heightAndDepth[count][1] = height; count++; } - //old code - /*boolean[] projection = ThreadMapUtil.getProjection(WORLD_HEIGHT + 1); - short[][] heightAndDepth = ThreadMapUtil.getHeightAndDepth((WORLD_HEIGHT / 2) + 1); - long[] singleDataToMerge = ThreadMapUtil.getSingleAddDataToMerge(dataToMerge.length); - int genMode = DistanceGenerationMode.SERVER.complexity; - boolean allEmpty = true; - boolean allVoid = true; - long singleData; - - for(int k=0; k < projection.length; k++) - projection[k] = false; - short depth = 0; - short height = 0; - //We collect the indexes of the data, ordered by the depth - for (int index = 0; index < dataToMerge.length; index++) - { - for (int dataIndex = 0; dataIndex < dataToMerge[index].length; dataIndex++) - { - singleData = dataToMerge[index][dataIndex]; - if (doesItExist(singleData)) - { - genMode = Math.min(genMode, getGenerationMode(singleData)); - allEmpty = false; - if (!isItVoid(singleData)) - { - allVoid = false; - depth = getDepth(singleData); - height = getHeight(singleData); - for (int y = depth; y <= height; y++) - { - projection[y] = true; - } - } - } - } - } - - //We check if there is any data that's not empty or void - if (allEmpty) - { - return new long[]{EMPTY_DATA}; - } - if (allVoid) - { - return new long[]{createVoidDataPoint(genMode)}; - } - - int count = 0; - int i = 0; - while (i < projection.length) - { - while (i < projection.length && !projection[i]) - { - i++; - } - depth = (short) i; - while (i < projection.length && projection[i]) - { - height = (short) i; - i++; - } - if(!(i < projection.length)) - break; - heightAndDepth[count][0] = depth; - heightAndDepth[count][1] = height; - count++; - }*/ - //end of changes //As standard the vertical lods are ordered from top to bottom long[] dataPoint = new long[count]; diff --git a/src/main/java/com/seibel/lod/util/ThreadMapUtil.java b/src/main/java/com/seibel/lod/util/ThreadMapUtil.java index d66007338..d5219b749 100644 --- a/src/main/java/com/seibel/lod/util/ThreadMapUtil.java +++ b/src/main/java/com/seibel/lod/util/ThreadMapUtil.java @@ -20,7 +20,6 @@ public class ThreadMapUtil public static final ConcurrentMap threadAdjData = new ConcurrentHashMap<>(); - public static final ConcurrentMap projectionMap = new ConcurrentHashMap<>(); public static final ConcurrentMap projectionShortMap = new ConcurrentHashMap<>(); public static final ConcurrentMap heightAndDepthMap = new ConcurrentHashMap<>(); public static final ConcurrentMap singleDataToMergeMap = new ConcurrentHashMap<>(); @@ -116,16 +115,6 @@ public class ThreadMapUtil return threadVerticalIndexesMap.get(Thread.currentThread().getName()); } - - - public static boolean[] getProjection(int size){ - if(!projectionMap.containsKey(Thread.currentThread().getName()) || (projectionMap.get(Thread.currentThread().getName()) == null) || (projectionMap.get(Thread.currentThread().getName()).length != size)) - { - projectionMap.put(Thread.currentThread().getName(), new boolean[size]); - } - return projectionMap.get(Thread.currentThread().getName()); - } - public static short[] getProjectionShort(int size){ if(!projectionShortMap.containsKey(Thread.currentThread().getName()) || (projectionShortMap.get(Thread.currentThread().getName()) == null) || (projectionShortMap.get(Thread.currentThread().getName()).length != size)) {