diff options
author | Oz Linden <oz@lindenlab.com> | 2014-04-22 15:59:28 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2014-04-22 15:59:28 -0400 |
commit | 90d7e9ba8c547ab505270028c13ab4f9283f711b (patch) | |
tree | ba7014129995659bcc26e96dfd0cfbcc27a99a8a | |
parent | b1a7137ba6e56e1b692205f129d86acc942209e9 (diff) | |
parent | 1173dde898d5b61749b1c1631d060bf6730b9642 (diff) |
merge changes for STORM-2023
-rwxr-xr-x | indra/llwindow/llwindowmacosx.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 11c0b51086..ed0348e10e 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -39,6 +39,7 @@ #include "indra_constants.h" #include <OpenGL/OpenGL.h> +#include <Carbon/Carbon.h> #include <CoreServices/CoreServices.h> extern BOOL gDebugWindowProc; @@ -1743,16 +1744,34 @@ LLSD LLWindowMacOSX::getNativeKeyData() return result; } - BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b) { - // Is this even used anywhere? Do we really need an OS color picker? BOOL retval = FALSE; - //S32 error = 0; + OSErr error = noErr; + NColorPickerInfo info; + + memset(&info, 0, sizeof(info)); + info.theColor.color.rgb.red = (UInt16)(*r * 65535.f); + info.theColor.color.rgb.green = (UInt16)(*g * 65535.f); + info.theColor.color.rgb.blue = (UInt16)(*b * 65535.f); + info.placeWhere = kCenterOnMainScreen; + + error = NPickColor(&info); + + if (error == noErr) + { + retval = info.newColorChosen; + if (info.newColorChosen) + { + *r = ((float) info.theColor.color.rgb.red) / 65535.0; + *g = ((float) info.theColor.color.rgb.green) / 65535.0; + *b = ((float) info.theColor.color.rgb.blue) / 65535.0; + } + } + return (retval); } - void *LLWindowMacOSX::getPlatformWindow() { // NOTE: this will be NULL in fullscreen mode. Plan accordingly. |