From 2ed35bc88c0b74f64c136466da1fcbb64ff9054b Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 9 Jun 2005 04:36:00 +0000 Subject: [PATCH] Thanks to Axel's change, now we can pass the app_server's colormap to libbe. Methods like BScreen::ColorMap() and BScreen::ColorForIndex() work. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13023 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/PrivateScreen.cpp | 10 +++------- src/servers/app/ServerApp.cpp | 5 +---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/kits/interface/PrivateScreen.cpp b/src/kits/interface/PrivateScreen.cpp index ae79a50d9e..49a865c799 100644 --- a/src/kits/interface/PrivateScreen.cpp +++ b/src/kits/interface/PrivateScreen.cpp @@ -189,11 +189,9 @@ BPrivateScreen::IndexForColor(uint8 red, uint8 green, uint8 blue, uint8 alpha) blue == B_TRANSPARENT_COLOR.blue && alpha == B_TRANSPARENT_COLOR.alpha) return B_TRANSPARENT_8_BIT; - + uint8 index = ((red & 0xf8) << 7) | ((green & 0xf8) << 2) | (blue >> 3); if (fColorMap) - return fColorMap->index_map[((red & 0xf8) << 7) - | ((green & 0xf8) << 2) - | (blue >> 3)]; + return fColorMap->index_map[index]; return 0; } @@ -473,9 +471,7 @@ BPrivateScreen::BPrivateScreen() if (reply == SERVER_TRUE) { fColorMap = (color_map *)malloc(sizeof(color_map)); fOwnsColorMap = true; - // TODO: This doesn't work. We probably ran into a port - // capacity issue ? - //link.Read(fColorMap); + link.Read(fColorMap); } } diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 01db1449fd..27e425a0cf 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -1769,10 +1769,7 @@ printf("ServerApp %s: AS_SCREEN_GET_MODE\n", fSignature.String()); link.Read(&id); fLink.StartMessage(SERVER_TRUE); - - // TODO: this doesn't seem to work. - //See also comment in BPrivateScreen::BPrivateScreen() - //fLink.Attach(*SystemColorMap()); + fLink.Attach(*SystemColorMap()); fLink.Flush(); break; }