diff options
Diffstat (limited to 'indra/newview/llglsandbox.cpp')
-rw-r--r-- | indra/newview/llglsandbox.cpp | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 842911ecc0..1208c9378e 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -115,7 +115,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) S32 center_y = (top + bottom) / 2; // save drawing mode - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); BOOL limit_select_distance = gSavedSettings.getBOOL("LimitSelectDistance"); @@ -230,9 +230,9 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) } // restore drawing mode - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); // restore camera LLViewerCamera::getInstance()->setFar(old_far_plane); @@ -240,7 +240,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) gViewerWindow->setup3DRender(); } -const F32 WIND_ALTITUDE = 180.f; +const F32 WIND_RELATIVE_ALTITUDE = 25.f; void LLWind::renderVectors() { @@ -254,13 +254,13 @@ void LLWind::renderVectors() gGL.pushMatrix(); LLVector3 origin_agent; origin_agent = gAgent.getPosAgentFromGlobal(mOriginGlobal); - gGL.translatef(origin_agent.mV[VX], origin_agent.mV[VY], WIND_ALTITUDE); + gGL.translatef(origin_agent.mV[VX], origin_agent.mV[VY], gAgent.getPositionAgent().mV[VZ] + WIND_RELATIVE_ALTITUDE); for (j = 0; j < mSize; j++) { for (i = 0; i < mSize; i++) { - x = mCloudVelX[i + j*mSize] * WIND_SCALE_HACK; - y = mCloudVelY[i + j*mSize] * WIND_SCALE_HACK; + x = mVelX[i + j*mSize] * WIND_SCALE_HACK; + y = mVelY[i + j*mSize] * WIND_SCALE_HACK; gGL.pushMatrix(); gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.0); gGL.color3f(0,1,0); @@ -620,7 +620,7 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV F32 pos_y = pos.mV[VY]; LLGLSUIDefault gls_ui; - LLGLDepthTest gls_depth(GL_TRUE); + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); LLGLDisable cull(GL_CULL_FACE); if (mCollisionBanned == BA_BANNED) @@ -777,13 +777,17 @@ void LLViewerObjectList::renderObjectBeacons() LLGLSUIDefault gls_ui; + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - BOOL flush = FALSE; for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { const LLDebugBeacon &debug_beacon = *iter; @@ -792,18 +796,14 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (flush) - { - gGL.end(); - } - flush = TRUE; gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; - gGL.begin(LLRender::LINES); } const LLVector3 &thisline = debug_beacon.mPositionAgent; + + gGL.begin(LLRender::LINES); gGL.color4fv(color.mV); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 50.f); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 50.f); @@ -813,8 +813,9 @@ void LLViewerObjectList::renderObjectBeacons() gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 2.f,thisline.mV[VZ]); draw_line_cube(0.10f, thisline); + + gGL.end(); } - gGL.end(); } { @@ -824,7 +825,6 @@ void LLViewerObjectList::renderObjectBeacons() S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - BOOL flush = FALSE; for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { const LLDebugBeacon &debug_beacon = *iter; @@ -832,18 +832,13 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (flush) - { - gGL.end(); - } - flush = TRUE; gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; - gGL.begin(LLRender::LINES); } const LLVector3 &thisline = debug_beacon.mPositionAgent; + gGL.begin(LLRender::LINES); gGL.color4fv(debug_beacon.mColor.mV); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 0.5f); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 0.5f); @@ -853,9 +848,10 @@ void LLViewerObjectList::renderObjectBeacons() gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 0.5f,thisline.mV[VZ]); draw_line_cube(0.10f, thisline); + + gGL.end(); } - gGL.end(); gGL.flush(); glLineWidth(1.f); |