Commit 6dab56f9 authored by Joel Martin's avatar Joel Martin

Working RRE implementation.

parent ed7e776d
...@@ -207,6 +207,7 @@ display_raw: function () { ...@@ -207,6 +207,7 @@ display_raw: function () {
debug(">> display_raw"); debug(">> display_raw");
Canvas.rfbImage(FBU.x, FBU.y, FBU.width, FBU.height, FBU.arr); Canvas.rfbImage(FBU.x, FBU.y, FBU.width, FBU.height, FBU.arr);
FBU.rects --; FBU.rects --;
FBU.arr = [];
}, },
display_copy_rect: function () { display_copy_rect: function () {
...@@ -215,31 +216,35 @@ display_copy_rect: function () { ...@@ -215,31 +216,35 @@ display_copy_rect: function () {
var old_y = FBU.arr.shift16(); var old_y = FBU.arr.shift16();
Canvas.copyImage(old_x, old_y, FBU.x, FBU.y, FBU.width, FBU.height); Canvas.copyImage(old_x, old_y, FBU.x, FBU.y, FBU.width, FBU.height);
FBU.rects --; FBU.rects --;
FBU.arr = [];
}, },
display_rre: function () { display_rre: function () {
debug(">> display_rre"); //debug(">> display_rre");
if (FBU.subrects == 0) { if (FBU.subrects == 0) {
debug("Processing new RRE");
FBU.subrects = FBU.arr.shift32(); FBU.subrects = FBU.arr.shift32();
var color = data.shiftBytes(FBU.fb_Bpp); // Background debug("RRE (" + FBU.subrects + " subrects)");
var color = FBU.arr.shiftBytes(RFB.fb_Bpp); // Background
Canvas.rfbRect(FBU.x, FBU.y, FBU.width, FBU.height, color); Canvas.rfbRect(FBU.x, FBU.y, FBU.width, FBU.height, color);
} else { } else {
/* Render one sub-rectangle */ /* Render one sub-rectangle */
FBU.subrects --; FBU.subrects --;
var color = data.shiftBytes(FBU.fb_Bpp); var color = FBU.arr.shiftBytes(RFB.fb_Bpp);
var x = data.shift16(); var x = FBU.arr.shift16();
var y = data.shift16(); var y = FBU.arr.shift16();
var width = data.shift16(); var width = FBU.arr.shift16();
var height = data.shift16(); var height = FBU.arr.shift16();
Canvas.rfbRect(x, y, width, height, color); Canvas.rfbRect(FBU.x + x, FBU.y + y, width, height, color);
} }
//debug("rects: " + FBU.rects + ", FBU.subrects: " + FBU.subrects);
if (FBU.subrects > 0) { if (FBU.subrects > 0) {
FBU.bytes = (8 + FBU.fb_Bpp); FBU.bytes = (RFB.fb_Bpp + 8); // One more
} else { } else {
FBU.rect --; FBU.rects --;
FBU.arr = [];
} }
//debug("<< display_rre, FBU.bytes: " + FBU.bytes);
}, },
...@@ -264,7 +269,7 @@ normal_msg: function (data) { ...@@ -264,7 +269,7 @@ normal_msg: function (data) {
} }
while (data.length > 0) { while (data.length > 0) {
debug("data.length: " + data.length + ", FBU.bytes: " + FBU.bytes); //debug("data.length: " + data.length + ", FBU.bytes: " + FBU.bytes);
if (FBU.bytes == 0) { if (FBU.bytes == 0) {
FBU.x = data.shift16(); FBU.x = data.shift16();
FBU.y = data.shift16(); FBU.y = data.shift16();
...@@ -280,7 +285,6 @@ normal_msg: function (data) { ...@@ -280,7 +285,6 @@ normal_msg: function (data) {
FBU.bytes = 4; FBU.bytes = 4;
break; break;
case 2: // RRE case 2: // RRE
debug("RRE");
FBU.bytes = 4 + RFB.fb_Bpp; FBU.bytes = 4 + RFB.fb_Bpp;
break; break;
} }
......
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