diff options
author | Brad Kittenbrink <brad@lindenlab.com> | 2009-02-18 21:10:16 +0000 |
---|---|---|
committer | Brad Kittenbrink <brad@lindenlab.com> | 2009-02-18 21:10:16 +0000 |
commit | abdc99f21b542c4fea67030ddbd7166c9d1c6c63 (patch) | |
tree | 3e984e405adfdec189ca8a047daca5250737ffbf /indra/llwindow/llwindowsdl.cpp | |
parent | 34412f0530cf6a411b4de906a8e9da59cbcb3a85 (diff) |
Merge of QAR-1267 to trunk. This was a combo merge of QAR-1175 (maint-render-9) and QAR-1236 (dll-msvcrt-2)
svn merge -r 109838:112264 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-render/maint-render-9-merge-r109833
Diffstat (limited to 'indra/llwindow/llwindowsdl.cpp')
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 6b1b6f4d60..1a724b5f77 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -271,7 +271,7 @@ static SDL_Surface *Load_BMP_Resource(const char *basename) #if LL_X11 // This is an XFree86/XOrg-specific hack for detecting the amount of Video RAM // on this machine. It works by searching /var/log/var/log/Xorg.?.log or -// /var/log/XFree86.?.log for a ': (VideoRAM|Memory): (%d+) kB' regex, where +// /var/log/XFree86.?.log for a ': (VideoRAM ?|Memory): (%d+) kB' regex, where // '?' is the X11 display number derived from $DISPLAY static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str) { @@ -285,6 +285,8 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str) // favourite regex implementation - libboost_regex - is // quite a heavy and troublesome dependency for the client, so // it seems a shame to introduce it for such a simple task. + // *FIXME: libboost_regex is a dependency now anyway, so we may + // as well use it instead of this hand-rolled nonsense. const char *part1_template = prefix_str; const char part2_template[] = " kB"; char *part1 = strstr(line_buf, part1_template); @@ -361,8 +363,17 @@ static int x11_detect_VRAM_kb() fp = fopen(fname.c_str(), "r"); if (fp) { - rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); + rtn = x11_detect_VRAM_kb_fp(fp, ": Video RAM: "); fclose(fp); + if (0 == rtn) + { + fp = fopen(fname.c_str(), "r"); + if (fp) + { + rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); + fclose(fp); + } + } } } } |