Remove full support for colour maps
Gets rid of a loooot of code and complexity.
Colour map clients are still supported through an
automatically generated map, but we lose the ability to
develop a client or server that uses colour maps
internally.
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index ed9f845..48acf0a 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -306,10 +306,6 @@
}
}
-void SConnection::setInitialColourMap()
-{
-}
-
void SConnection::clientInit(bool shared)
{
writer_->writeServerInit();
@@ -320,6 +316,8 @@
{
SMsgHandler::setPixelFormat(pf);
readyForSetColourMapEntries = true;
+ if (!pf.trueColour)
+ writeFakeColourMap();
}
void SConnection::framebufferUpdateRequest(const Rect& r, bool incremental)
@@ -327,7 +325,7 @@
if (!readyForSetColourMapEntries) {
readyForSetColourMapEntries = true;
if (!cp.pf().trueColour) {
- setInitialColourMap();
+ writeFakeColourMap();
}
}
}
@@ -347,3 +345,14 @@
int x, int y, int w, int h)
{
}
+
+void SConnection::writeFakeColourMap(void)
+{
+ int i;
+ rdr::U16 red[256], green[256], blue[256];
+
+ for (i = 0;i < 256;i++)
+ cp.pf().rgbFromPixel(i, &red[i], &green[i], &blue[i]);
+
+ writer()->writeSetColourMapEntries(0, 256, red, green, blue);
+}