diff options
Diffstat (limited to 'linden/indra/llwindow/llwindowmacosx.cpp')
-rw-r--r-- | linden/indra/llwindow/llwindowmacosx.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp index d990bb5..7313fd3 100644 --- a/linden/indra/llwindow/llwindowmacosx.cpp +++ b/linden/indra/llwindow/llwindowmacosx.cpp | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "linden_common.h" | 30 | #include "linden_common.h" |
31 | 31 | ||
32 | #include <Carbon/Carbon.h> | 32 | #include <Carbon/Carbon.h> |
33 | #include <OpenGL/OpenGL.h> | ||
33 | 34 | ||
34 | #include "llwindowmacosx.h" | 35 | #include "llwindowmacosx.h" |
35 | #include "llkeyboardmacosx.h" | 36 | #include "llkeyboardmacosx.h" |
@@ -89,8 +90,8 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card) | |||
89 | { | 90 | { |
90 | if (!strnicmp(RENDERER, bad_card, strlen(bad_card))) | 91 | if (!strnicmp(RENDERER, bad_card, strlen(bad_card))) |
91 | { | 92 | { |
92 | char buffer[1024]; | 93 | char buffer[1024];/* Flawfinder: ignore */ |
93 | sprintf(buffer, | 94 | snprintf(buffer, sizeof(buffer), /* Flawfinder: ignore */ |
94 | "Your video card appears to be a %s, which Second Life does not support.\n" | 95 | "Your video card appears to be a %s, which Second Life does not support.\n" |
95 | "\n" | 96 | "\n" |
96 | "Second Life requires a video card with 32 Mb of memory or more, as well as\n" | 97 | "Second Life requires a video card with 32 Mb of memory or more, as well as\n" |
@@ -246,8 +247,8 @@ LLWindowMacOSX::LLWindowMacOSX(char *title, char *name, S32 x, S32 y, S32 width, | |||
246 | mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); | 247 | mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); |
247 | 248 | ||
248 | // Stash the window title | 249 | // Stash the window title |
249 | strcpy((char*)mWindowTitle + 1, title); | 250 | strcpy((char*)mWindowTitle + 1, title); /* Flawfinder: ignore */ |
250 | mWindowTitle[0] = strlen(title); | 251 | mWindowTitle[0] = strlen(title); /* Flawfinder: ignore */ |
251 | 252 | ||
252 | mEventHandlerUPP = NewEventHandlerUPP(staticEventHandler); | 253 | mEventHandlerUPP = NewEventHandlerUPP(staticEventHandler); |
253 | mGlobalHandlerRef = NULL; | 254 | mGlobalHandlerRef = NULL; |
@@ -424,8 +425,8 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
424 | mFullscreenBits = -1; | 425 | mFullscreenBits = -1; |
425 | mFullscreenRefresh = -1; | 426 | mFullscreenRefresh = -1; |
426 | 427 | ||
427 | char error[256]; | 428 | char error[256]; /* Flawfinder: ignore */ |
428 | sprintf(error, "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); | 429 | snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); /* Flawfinder: ignore */ |
429 | OSMessageBox(error, "Error", OSMB_OK); | 430 | OSMessageBox(error, "Error", OSMB_OK); |
430 | } | 431 | } |
431 | } | 432 | } |
@@ -738,6 +739,22 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits | |||
738 | } | 739 | } |
739 | aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); | 740 | aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); |
740 | 741 | ||
742 | #if 0 // SJB: Got a compile error. Plus I don't want to test this along with everything else ; save it for later | ||
743 | //enable multi-threaded OpenGL | ||
744 | CGLError cgl_err; | ||
745 | CGLContextObj ctx = CGLGetCurrentContext(); | ||
746 | |||
747 | cgl_err = CGLEnable( ctx, kCGLCEMPEngine); | ||
748 | |||
749 | if (cgl_err != kCGLNoError ) | ||
750 | { | ||
751 | llinfos << "Multi-threaded OpenGL not available." << llendl; | ||
752 | } | ||
753 | else | ||
754 | { | ||
755 | llinfos << "Multi-threaded OpenGL enabled." << llendl; | ||
756 | } | ||
757 | #endif | ||
741 | // Don't need to get the current gamma, since there's a call that restores it to the system defaults. | 758 | // Don't need to get the current gamma, since there's a call that restores it to the system defaults. |
742 | return TRUE; | 759 | return TRUE; |
743 | } | 760 | } |
@@ -2738,7 +2755,7 @@ void spawn_web_browser(const char* escaped_url) | |||
2738 | S32 i; | 2755 | S32 i; |
2739 | for (i = 0; i < gURLProtocolWhitelistCount; i++) | 2756 | for (i = 0; i < gURLProtocolWhitelistCount; i++) |
2740 | { | 2757 | { |
2741 | S32 len = strlen(gURLProtocolWhitelist[i]); | 2758 | S32 len = strlen(gURLProtocolWhitelist[i]); /* Flawfinder: ignore */ |
2742 | if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len) | 2759 | if (!strncmp(escaped_url, gURLProtocolWhitelist[i], len) |
2743 | && escaped_url[len] == ':') | 2760 | && escaped_url[len] == ':') |
2744 | { | 2761 | { |