diff --git a/core/src/com/riiablo/codec/D2.java b/core/src/com/riiablo/codec/D2.java index fe68e48f..17cff8df 100644 --- a/core/src/com/riiablo/codec/D2.java +++ b/core/src/com/riiablo/codec/D2.java @@ -98,20 +98,15 @@ public class D2 { public String cof; public int framesPerDir; - public short speed; - public short unk1; - public short zero; + public int speed; public byte data[]; Entry(InputStream in) throws IOException { ByteBuffer buffer = ByteBuffer.wrap(IOUtils.readFully(in, SIZE)).order(ByteOrder.LITTLE_ENDIAN); cof = BufferUtils.readString2(buffer, 8); framesPerDir = buffer.getInt(); - speed = (short) (buffer.get() & 0xFF); - unk1 = (short) (buffer.get() & 0xFF); - zero = buffer.getShort(); + speed = buffer.getInt(); data = BufferUtils.readBytes(buffer, 144); - assert zero == 0; assert !buffer.hasRemaining(); } @@ -121,8 +116,6 @@ public class D2 { .append("cof", cof) .append("framesPerDir", framesPerDir) .append("speed", speed) - .append("unk1", unk1) - .append("zero", zero) //.append("data", data) .build(); } diff --git a/tools/src/com/riiablo/codec/D2Finder.java b/tools/src/com/riiablo/codec/D2Finder.java index ff7657ce..8c5237a7 100644 --- a/tools/src/com/riiablo/codec/D2Finder.java +++ b/tools/src/com/riiablo/codec/D2Finder.java @@ -13,6 +13,7 @@ import com.riiablo.mpq.MPQFileHandleResolver; import com.riiablo.util.DebugUtils; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.tuple.Pair; import java.io.PrintWriter; @@ -79,7 +80,6 @@ public class D2Finder extends ApplicationAdapter { writer.println("cof" + '\t' + "framesPerDir" + '\t' + "speed" - + '\t' + "unk1" + '\t' + "data" ); for (D2.Block block : lib.blocks) { @@ -87,9 +87,8 @@ public class D2Finder extends ApplicationAdapter { for (D2.Entry entry : block.entries) { writer.println(entry.cof + '\t' + entry.framesPerDir - + '\t' + (entry.speed & 0xFF) - + '\t' + (entry.unk1 & 0xFF) - + '\t' + DebugUtils.toByteArray(entry.data) + + '\t' + entry.speed + + '\t' + (ArrayUtils.isSorted(entry.data) ? "" : DebugUtils.toByteArray(entry.data)) ); } }