mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-06 00:08:19 +07:00
Updated DccDecoderTest to new Dcc spec
Implemented Dcc release for each refCnt Updated pixelCodeAndDisplacementBitStream assertion message
This commit is contained in:
@ -25,10 +25,10 @@ public final class DccDecoder {
|
||||
final Bitmap bmp = new Bitmap();
|
||||
|
||||
public void decode(Dcc dcc, int d) {
|
||||
decode(dcc, dcc.directions[d]);
|
||||
decode(dcc, d, dcc.directions[d]);
|
||||
}
|
||||
|
||||
void decode(Dcc dcc, DccDirection dir) {
|
||||
void decode(Dcc dcc, int d, DccDirection dir) {
|
||||
directionBuffer.clear(dir);
|
||||
pixelBuffer.clear(directionBuffer.size);
|
||||
decodeFrames(dir, dcc.numFrames);
|
||||
@ -40,7 +40,9 @@ public final class DccDecoder {
|
||||
assert dir.pixelMaskBitStream.bitsRemaining() == 0;
|
||||
assert dir.encodingTypeBitStream.bitsRemaining() == 0;
|
||||
assert dir.rawPixelCodesBitStream.bitsRemaining() == 0;
|
||||
assert dir.pixelCodeAndDisplacementBitStream.bytesRemaining() == 0 : dir.pixelCodeAndDisplacementBitStream.bytesRemaining();
|
||||
assert dir.pixelCodeAndDisplacementBitStream.bytesRemaining() == 0 :
|
||||
String.format("dcc: %s, dir: %d, bytesRemaining: %d",
|
||||
dcc.handle, d, dir.pixelCodeAndDisplacementBitStream.bytesRemaining());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,6 +145,8 @@ public class DccDecoderTest {
|
||||
"data\\global\\chars\\ba\\hd\\bahdbhma11hs.dcc",
|
||||
"data\\global\\chars\\ba\\lg\\balglittnhth.dcc",
|
||||
"data\\global\\chars\\ba\\hd\\bahdlittnhth.dcc",
|
||||
"data\\global\\chars\\ba\\s2\\bas2littnhth.dcc",
|
||||
"data\\global\\chars\\so\\s2\\sos2medtnhth.dcc",
|
||||
})
|
||||
void draw_pixmaps(String dccName) throws Exception {
|
||||
FileHandle testHome = InstallationFinder.getInstance().defaultHomeDir();
|
||||
@ -226,7 +228,10 @@ public class DccDecoderTest {
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
dcc.dispose(); // also releases dccHandle reference
|
||||
// also releases dccHandle reference
|
||||
// release twice, once for header, again for direction
|
||||
ReferenceCountUtil.release(dcc);
|
||||
ReferenceCountUtil.release(dcc);
|
||||
AssetUtils.dispose(paletteTexture);
|
||||
AssetUtils.dispose(shader);
|
||||
AssetUtils.dispose(batch);
|
||||
@ -243,6 +248,8 @@ public class DccDecoderTest {
|
||||
"data\\global\\chars\\ba\\hd\\bahdbhma11hs.dcc",
|
||||
"data\\global\\chars\\ba\\lg\\balglittnhth.dcc",
|
||||
"data\\global\\chars\\ba\\hd\\bahdlittnhth.dcc",
|
||||
"data\\global\\chars\\ba\\s2\\bas2littnhth.dcc",
|
||||
"data\\global\\chars\\so\\s2\\sos2medtnhth.dcc",
|
||||
})
|
||||
void draw_pixmaps2(String dccName) throws Exception {
|
||||
FileHandle testHome = InstallationFinder.getInstance().defaultHomeDir();
|
||||
|
Reference in New Issue
Block a user