don't need to copy palette data until we have all data for rect; change a few comments
This commit is contained in:
parent
5ca5e2d8cd
commit
c514fd5e1c
|
@ -1315,11 +1315,8 @@ encHandlers.TIGHT = function display_tight() {
|
||||||
var numColors = rQ[rQi + 2] + 1;
|
var numColors = rQ[rQi + 2] + 1;
|
||||||
var paletteSize = numColors * fb_depth;
|
var paletteSize = numColors * fb_depth;
|
||||||
FBU.bytes += paletteSize;
|
FBU.bytes += paletteSize;
|
||||||
|
|
||||||
if (ws.rQwait("TIGHT palette " + cmode, FBU.bytes)) { return false; }
|
if (ws.rQwait("TIGHT palette " + cmode, FBU.bytes)) { return false; }
|
||||||
|
|
||||||
FBU.palette = ws.rQslice(3, 3 + paletteSize);
|
|
||||||
|
|
||||||
var bpp = (numColors <= 2) ? 1 : 8;
|
var bpp = (numColors <= 2) ? 1 : 8;
|
||||||
var rowSize = Math.floor((FBU.width * bpp + 7) / 8);
|
var rowSize = Math.floor((FBU.width * bpp + 7) / 8);
|
||||||
var raw = false;
|
var raw = false;
|
||||||
|
@ -1333,14 +1330,16 @@ encHandlers.TIGHT = function display_tight() {
|
||||||
if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
|
if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
|
||||||
|
|
||||||
// Shift ctl, filter id, num colors, palette entries, and clength off
|
// Shift ctl, filter id, num colors, palette entries, and clength off
|
||||||
ws.rQshiftBytes(3 + paletteSize + clength[0]);
|
ws.rQshiftBytes(3);
|
||||||
|
FBU.palette = ws.rQshiftBytes(paletteSize);
|
||||||
|
ws.rQshiftBytes(clength[0]);
|
||||||
|
|
||||||
// Decompress data
|
|
||||||
if (raw)
|
if (raw)
|
||||||
data = ws.rQshiftBytes(clength[1]);
|
data = ws.rQshiftBytes(clength[1]);
|
||||||
else
|
else
|
||||||
data = decompress(ws.rQshiftBytes(clength[1]));
|
data = decompress(ws.rQshiftBytes(clength[1]));
|
||||||
|
|
||||||
|
// Convert indexed (palette based) image data to RGB
|
||||||
var dest = [];
|
var dest = [];
|
||||||
var x, y, b;
|
var x, y, b;
|
||||||
if (numColors == 2) {
|
if (numColors == 2) {
|
||||||
|
@ -1395,10 +1394,12 @@ encHandlers.TIGHT = function display_tight() {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
clength = getCLength(ws.rQslice(1, 4));
|
clength = getCLength(ws.rQslice(1, 4));
|
||||||
FBU.bytes = 1 + clength[0] + clength[1]; // ctl + clength size + zlib-data
|
FBU.bytes = 1 + clength[0] + clength[1];
|
||||||
if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
|
if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
|
||||||
|
|
||||||
ws.rQshiftBytes(1 + clength[0]); // ctl + clength
|
// Shift ctl, clength off
|
||||||
|
ws.rQshiftBytes(1 + clength[0]);
|
||||||
|
|
||||||
if (raw)
|
if (raw)
|
||||||
data = ws.rQshiftBytes(clength[1]);
|
data = ws.rQshiftBytes(clength[1]);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue