mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-09 07:18:03 +07:00
Improved D2.Entry
Renamed b1 to speed and changed to unsigned byte as short Renamed b2 to unk1 and changed to unsigned byte as short Added assertion that zero is really 0
This commit is contained in:
@ -98,7 +98,8 @@ public class D2 {
|
||||
|
||||
public String cof;
|
||||
public int framesPerDir;
|
||||
public byte b1, b2;
|
||||
public short speed;
|
||||
public short unk1;
|
||||
public short zero;
|
||||
public byte data[];
|
||||
|
||||
@ -106,10 +107,11 @@ public class D2 {
|
||||
ByteBuffer buffer = ByteBuffer.wrap(IOUtils.readFully(in, SIZE)).order(ByteOrder.LITTLE_ENDIAN);
|
||||
cof = BufferUtils.readString2(buffer, 8);
|
||||
framesPerDir = buffer.getInt();
|
||||
b1 = buffer.get();
|
||||
b2 = buffer.get();
|
||||
speed = (short) (buffer.get() & 0xFF);
|
||||
unk1 = (short) (buffer.get() & 0xFF);
|
||||
zero = buffer.getShort();
|
||||
data = BufferUtils.readBytes(buffer, 144);
|
||||
assert zero == 0;
|
||||
assert !buffer.hasRemaining();
|
||||
}
|
||||
|
||||
@ -118,8 +120,8 @@ public class D2 {
|
||||
return new ToStringBuilder(this)
|
||||
.append("cof", cof)
|
||||
.append("framesPerDir", framesPerDir)
|
||||
.append("b1", b1 & 0xFF)
|
||||
.append("b2", b2 & 0xFF)
|
||||
.append("speed", speed)
|
||||
.append("unk1", unk1)
|
||||
.append("zero", zero)
|
||||
//.append("data", data)
|
||||
.build();
|
||||
|
Reference in New Issue
Block a user