aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-09 05:50:02 +0200
committermakamys <makamys@outlook.com>2021-05-09 05:50:02 +0200
commit16ccbfa46653164630e73b6e43e707f86131c718 (patch)
tree13c533189987d47959a2244c8a24f2ad5e1f6c33 /src
parentf40313f7e51752cd12460527cd68bc7e296b25d2 (diff)
downloadNeodymium-16ccbfa46653164630e73b6e43e707f86131c718.tar.gz
Neodymium-16ccbfa46653164630e73b6e43e707f86131c718.tar.bz2
Neodymium-16ccbfa46653164630e73b6e43e707f86131c718.zip
Remove some junk from ChunkMesh
Diffstat (limited to 'src')
-rw-r--r--src/main/java/makamys/lodmod/renderer/ChunkMesh.java66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java
index 8fac2db..aacb7ca 100644
--- a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java
+++ b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java
@@ -246,72 +246,6 @@ public class ChunkMesh extends Mesh {
return (3 * 4 + (flags.hasTexture ? 8 : 0) + (flags.hasBrightness ? 4 : 0) + (flags.hasColor ? 4 : 0) + (flags.hasNormals ? 4 : 0));
}
- static ChunkMesh loadChunkMesh(int x, int y, int z) {
- try(DataInputStream in = new DataInputStream(new FileInputStream("tessellator_dump.dat"))){
- List<String> stringTable = Files.readAllLines(Paths.get("tessellator_strings.txt"));
-
- while(true) {
- int xOffset = in.readInt();
- int yOffset = in.readInt();
- int zOffset = in.readInt();
- Flags flags = new Flags(in.readByte());
-
- int quadSize = 2 + 4 * (3 + (flags.hasTexture ? 2 : 0) + (flags.hasBrightness ? 2 : 0)
- + (flags.hasColor ? 4 : 0) + (flags.hasNormals ? 4 : 0));
-
-
- int quadCount = in.readInt();
-
- if(xOffset == x && yOffset == y && zOffset == z) {
- byte[] data = new byte[quadSize * quadCount];
- in.read(data, 0, data.length);
-
- return new ChunkMesh(x, y, z, flags, quadCount, data, stringTable);
- } else {
- in.skip(quadSize * quadCount);
- }
- }
- } catch(EOFException eof) {
- System.out.println("end??");
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- // TODO don't repeat yourself
- static List<ChunkMesh> loadAll(){
- List<ChunkMesh> list = new ArrayList<ChunkMesh>();
- try(DataInputStream in = new DataInputStream(new FileInputStream("tessellator_dump.dat"))){
- List<String> stringTable = Files.readAllLines(Paths.get("tessellator_strings.txt"));
-
- while(true) {
- int xOffset = in.readInt();
- int yOffset = in.readInt();
- int zOffset = in.readInt();
- Flags flags = new Flags(in.readByte());
-
- int quadSize = 2 + 4 * (3 + (flags.hasTexture ? 2 : 0) + (flags.hasBrightness ? 2 : 0)
- + (flags.hasColor ? 4 : 0) + (flags.hasNormals ? 4 : 0));
-
-
- int quadCount = in.readInt();
-
- if(quadCount > 0) {
- byte[] data = new byte[quadSize * quadCount];
- in.read(data, 0, data.length);
-
- list.add(new ChunkMesh(xOffset, yOffset, zOffset, flags, quadCount, data, stringTable));
- }
- }
- } catch(EOFException eof) {
- System.out.println("end??");
- } catch (IOException e) {
- e.printStackTrace();
- }
- return list;
- }
-
static void saveChunks(List<Integer> coords) {
System.out.println("saving " + (coords.size() / 3) + " cchunks");
for(int i = 0; i < coords.size(); i += 3) {