collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
869 stars 99 forks source link

Add support for unaligned BitInput slices #118

Closed collinsmith closed 3 years ago

collinsmith commented 3 years ago

DCC requires reading unaligned BitInput slices. Workaround could be to never slice the stream, however this would require implementing support for generating duplicates of BitInput instances.

collinsmith commented 3 years ago

Re-opening this issue. Validations on multi-byte slices failed in some cases. Testing data\global\CHARS\BA\LG\BALGLITTNHTH.dcc pixelCodeAndDisplacementBitStream for correct behavior. I think this is due to how the underlying ByteBuf is sliced -- must include cache and a slice containing any future bytes that belong to the bit stream, however in the case of the above file the correct number of bytes are sliced, but the position appears to be incorrect and is exceeding bounds of the slice.

collinsmith commented 3 years ago

Should be resolved via 64fa1611e45752abb359ca193d940e516eb9ffc9