Merge remote branch 'origin/issue-70'

Conflicts:
	include/display.js
	include/rfb.js

This merges in the fix for https://github.com/kanaka/noVNC/issues/70

This changes noVNC to use the preferred color ordering that most VNC
server prefer and that VMWare VNC requires. It's possible this may
break some VNC servers out there in which case we might have to do
something a bit more subtle such as having alternate render functions
for little and big endian color ordering.
This commit is contained in:
Joel Martin
2012-01-12 17:07:07 -06:00
3 changed files with 61 additions and 51 deletions

View File

@@ -819,6 +819,16 @@ init_msg = function() {
", green_shift: " + green_shift +
", blue_shift: " + blue_shift);
if (big_endian !== 0) {
Util.Warn("Server native endian is not little endian");
}
if (red_shift !== 16) {
Util.Warn("Server native red-shift is not 16");
}
if (blue_shift !== 0) {
Util.Warn("Server native blue-shift is not 0");
}
/* Connection name/title */
name_length = ws.rQshift32();
fb_name = ws.rQshiftStr(name_length);
@@ -893,7 +903,7 @@ normal_msg = function() {
//Util.Debug("red after: " + red);
green = parseInt(ws.rQshift16() / 256, 10);
blue = parseInt(ws.rQshift16() / 256, 10);
display.set_colourMap([red, green, blue], first_colour + c);
display.set_colourMap([blue, green, red], first_colour + c);
}
Util.Debug("colourMap: " + display.get_colourMap());
Util.Info("Registered " + num_colours + " colourMap entries");
@@ -1429,9 +1439,9 @@ pixelFormat = function() {
arr.push16(255); // red-max
arr.push16(255); // green-max
arr.push16(255); // blue-max
arr.push8(0); // red-shift
arr.push8(16); // red-shift
arr.push8(8); // green-shift
arr.push8(16); // blue-shift
arr.push8(0); // blue-shift
arr.push8(0); // padding
arr.push8(0); // padding