Correct udp.js this.numColors bug
This commit is contained in:
parent
3c2fb60a3f
commit
2b0dee45c6
|
|
@ -14,7 +14,6 @@ import Inflator from "../inflator.js";
|
||||||
export default class UDPDecoder {
|
export default class UDPDecoder {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._filter = null;
|
this._filter = null;
|
||||||
this._numColors = 0;
|
|
||||||
this._palette = new Uint8Array(1024); // 256 * 4 (max palette size * max bytes-per-pixel)
|
this._palette = new Uint8Array(1024); // 256 * 4 (max palette size * max bytes-per-pixel)
|
||||||
|
|
||||||
this._zlibs = [];
|
this._zlibs = [];
|
||||||
|
|
@ -190,7 +189,7 @@ export default class UDPDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert indexed (palette based) image data to RGB
|
// Convert indexed (palette based) image data to RGB
|
||||||
if (this._numColors == 2) {
|
if (numColors == 2) {
|
||||||
this._monoRect(x, y, width, height, data, palette, display);
|
this._monoRect(x, y, width, height, data, palette, display);
|
||||||
} else {
|
} else {
|
||||||
this._paletteRect(x, y, width, height, data, palette, display);
|
this._paletteRect(x, y, width, height, data, palette, display);
|
||||||
|
|
@ -277,7 +276,7 @@ export default class UDPDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return data.slice(i, data.length - 1);
|
return data.slice(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
_getScratchBuffer(size) {
|
_getScratchBuffer(size) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue