From: <mg...@us...> - 2008-10-26 23:53:47
|
Revision: 2276 http://planeshift.svn.sourceforge.net/planeshift/?rev=2276&view=rev Author: mgist Date: 2008-10-26 23:53:42 +0000 (Sun, 26 Oct 2008) Log Message: ----------- - Merged r2272 from my branch. Modified Paths: -------------- trunk/src/client/entitylabels.cpp trunk/src/common/paws/pawstree.cpp Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /personal/Xordan:1745,1812,1894,2270 + /personal/Xordan:1745,1812,1894,2270,2272 Modified: trunk/src/client/entitylabels.cpp =================================================================== --- trunk/src/client/entitylabels.cpp 2008-10-26 21:26:18 UTC (rev 2275) +++ trunk/src/client/entitylabels.cpp 2008-10-26 23:53:42 UTC (rev 2276) @@ -59,7 +59,6 @@ #define SCALE 0.004 #define BORDER_SIZE 2 -int MakeColor(csPixelFormat * fmt, int r, int g, int b); int ParseColor(const csString & str, iGraphics2D *g2d); psEntityLabels::psEntityLabels() Modified: trunk/src/common/paws/pawstree.cpp =================================================================== --- trunk/src/common/paws/pawstree.cpp 2008-10-26 21:26:18 UTC (rev 2275) +++ trunk/src/common/paws/pawstree.cpp 2008-10-26 23:53:42 UTC (rev 2276) @@ -58,17 +58,6 @@ return (HexToDec4(first) << 4) + HexToDec4(second); } -int MakeColor(const csPixelFormat * fmt, int r, int g, int b) -{ - if (!fmt->PalEntries) - return ((r >> (8 - fmt->RedBits)) << fmt->RedShift) - | ((g >> (8 - fmt->GreenBits)) << fmt->GreenShift) - | ((b >> (8 - fmt->BlueBits)) << fmt->BlueShift); - - // In paletted mode this is easy since we have a uniform 3-3-2 palette - return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6); -} - // converts hexadecimal string to color in current pixel format int ParseColor(const csString & str, iGraphics2D *g2d) { @@ -81,7 +70,7 @@ g = HexToDec8(str.GetAt(2), str.GetAt(3)); b = HexToDec8(str.GetAt(4), str.GetAt(5)); - return MakeColor(g2d->GetPixelFormat(), r, g, b); + return g2d->FindRGB(r, g, b); } @@ -1080,8 +1069,8 @@ if (colSpace) colSpacing = colSpace->GetValueAsInt(); SetTreeDecorator(new pawsStdTreeDecorator(this, graphics2D, - MakeColor(graphics2D->GetPixelFormat(), selColour.red, selColour.blue, selColour.green), - MakeColor(graphics2D->GetPixelFormat(), lineColour.red, lineColour.blue, lineColour.green), + graphics2D->FindRGB(selColour.red, selColour.blue, selColour.green), + graphics2D->FindRGB(lineColour.red, lineColour.blue, lineColour.green), colSpacing)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |