Commit 14717eb4 authored by Joel Martin's avatar Joel Martin

Fix tight decoding when using binary/non-base64 connection.

parent 4dd1bb1e
...@@ -1252,11 +1252,11 @@ encHandlers.HEXTILE = function display_hextile() { ...@@ -1252,11 +1252,11 @@ encHandlers.HEXTILE = function display_hextile() {
rQi += FBU.bytes - 1; rQi += FBU.bytes - 1;
} else { } else {
if (FBU.subencoding & 0x02) { // Background if (FBU.subencoding & 0x02) { // Background
FBU.background = rQ.slice(rQi, rQi + fb_Bpp); FBU.background = rQ.subarray(rQi, rQi + fb_Bpp);
rQi += fb_Bpp; rQi += fb_Bpp;
} }
if (FBU.subencoding & 0x04) { // Foreground if (FBU.subencoding & 0x04) { // Foreground
FBU.foreground = rQ.slice(rQi, rQi + fb_Bpp); FBU.foreground = rQ.subarray(rQi, rQi + fb_Bpp);
rQi += fb_Bpp; rQi += fb_Bpp;
} }
...@@ -1266,7 +1266,7 @@ encHandlers.HEXTILE = function display_hextile() { ...@@ -1266,7 +1266,7 @@ encHandlers.HEXTILE = function display_hextile() {
rQi += 1; rQi += 1;
for (s = 0; s < subrects; s += 1) { for (s = 0; s < subrects; s += 1) {
if (FBU.subencoding & 0x10) { // SubrectsColoured if (FBU.subencoding & 0x10) { // SubrectsColoured
color = rQ.slice(rQi, rQi + fb_Bpp); color = rQ.subarray(rQi, rQi + fb_Bpp);
rQi += fb_Bpp; rQi += fb_Bpp;
} else { } else {
color = FBU.foreground; color = FBU.foreground;
......
...@@ -18,6 +18,10 @@ var Util = {}; ...@@ -18,6 +18,10 @@ var Util = {};
* Make arrays quack * Make arrays quack
*/ */
Array.prototype.subarray = function (start, end) {
this.slice(start, end);
};
Array.prototype.push8 = function (num) { Array.prototype.push8 = function (num) {
this.push(num & 0xFF); this.push(num & 0xFF);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment