aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llglsandbox.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llglsandbox.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llglsandbox.cpp')
-rw-r--r--linden/indra/newview/llglsandbox.cpp43
1 files changed, 1 insertions, 42 deletions
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp
index 30c76c9..45f674d 100644
--- a/linden/indra/newview/llglsandbox.cpp
+++ b/linden/indra/newview/llglsandbox.cpp
@@ -1102,7 +1102,7 @@ void LLViewerObjectList::renderObjectBeacons()
1102 color = debug_beacon.mTextColor; 1102 color = debug_beacon.mTextColor;
1103 color.mV[3] *= 1.f; 1103 color.mV[3] *= 1.f;
1104 1104
1105 hud_textp->setString(utf8str_to_wstring(debug_beacon.mString.c_str())); 1105 hud_textp->setString(utf8str_to_wstring(debug_beacon.mString));
1106 hud_textp->setColor(color); 1106 hud_textp->setColor(color);
1107 hud_textp->setPositionAgent(debug_beacon.mPositionAgent); 1107 hud_textp->setPositionAgent(debug_beacon.mPositionAgent);
1108 debug_beacon.mHUDObject = hud_textp; 1108 debug_beacon.mHUDObject = hud_textp;
@@ -1111,44 +1111,3 @@ void LLViewerObjectList::renderObjectBeacons()
1111} 1111}
1112 1112
1113 1113
1114void pre_show_depth_buffer()
1115{
1116 glClear(GL_STENCIL_BUFFER_BIT);
1117 glEnable(GL_STENCIL_TEST);
1118 glStencilFunc(GL_ALWAYS,0,0);
1119 glStencilOp(GL_INCR,GL_INCR,GL_INCR);
1120}
1121
1122void post_show_depth_buffer()
1123{
1124 int xsize =500, ysize =500;
1125 U8 *buf = new U8[xsize*ysize];
1126
1127 glReadPixels(0,0,xsize,ysize,GL_STENCIL_INDEX,GL_UNSIGNED_BYTE, buf);
1128
1129 int total = 0;
1130 int i;
1131 for (i=0;i<xsize*ysize;i++)
1132 {
1133 total += buf[i];
1134 buf[i] <<= 3;
1135 }
1136
1137 float DC = (float)total/(float)(ysize*xsize);
1138 int DCline = llfloor((xsize-20) * DC / 10.0f);
1139 int stride = xsize / 10;
1140
1141 int y = 2;
1142
1143 for (i=0;i<DCline;i++)
1144 {
1145 if (i % stride == 0) i+=2;
1146 if (i > xsize) y=6;
1147 buf[ysize*(y+0)+i]=255;
1148 buf[ysize*(y+1)+i]=255;
1149 buf[ysize*(y+2)+i]=255;
1150 }
1151 glDrawPixels(xsize,ysize,GL_RED,GL_UNSIGNED_BYTE,buf);
1152
1153 delete [] buf;
1154}