| Code: diff -durN cv1262225/indra/newview/llmanip.cpp cv1262226/indra/newview/llmanip.cpp --- cv1262225/indra/newview/llmanip.cpp 2018-11-06 19:04:59.725811654 +0100 +++ cv1262226/indra/newview/llmanip.cpp 2018-12-08 12:15:22.046325355 +0100 @@ -478,15 +478,70 @@ S32 window_center_x = gViewerWindowp->getWindowWidth() / 2; S32 window_center_y = gViewerWindowp->getWindowHeight() / 2; S32 vertical_offset = window_center_y - VERTICAL_OFFSET; + S32 center_y = window_center_y + vertical_offset; + + LLWString str_x = utf8str_to_wstring(llformat("X: %.3f", vec.mV[VX])); + LLWString str_y = utf8str_to_wstring(llformat("Y: %.3f", vec.mV[VY])); + LLWString str_z = utf8str_to_wstring(llformat("Z: %.3f", vec.mV[VZ])); + // A bug in MacOS-X OpenGL makes the trembling-coordinates fix inadequate + // for Mac builds (coordinates do not appear)... +#if LL_DARWIN gGL.pushMatrix(); { gViewerWindowp->setup2DRender(); + const LLVector2& display_scale = gViewerWindowp->getDisplayScale(); gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); gGL.color4f(0.f, 0.f, 0.f, 0.7f); + rounded_square->draw(window_center_x - 115, center_y - PAD, 235, + PAD * 2 + 10, LLColor4(0.f, 0.f, 0.f, 0.7f)); + } + gGL.popMatrix(); - S32 center_y = window_center_y + vertical_offset; + gViewerWindowp->setup3DRender(); + + { + LLVector3 camera_pos = gViewerCamera.getOrigin() + + gViewerCamera.getAtAxis(); + + LLLocale locale(LLLocale::USER_LOCALE); + LLGLDepthTest gls_depth(GL_FALSE); + + // Render drop shadowed text + hud_render_text(str_x, camera_pos, *font, LLFontGL::NORMAL, -101.f, + (F32)(vertical_offset - 1), LLColor4::black, false); + + hud_render_text(str_y, camera_pos, *font, LLFontGL::NORMAL, -26.f, + (F32)(vertical_offset - 1), LLColor4::black, false); + + hud_render_text(str_z, camera_pos, *font, LLFontGL::NORMAL, 49.f, + (F32)(vertical_offset - 1), LLColor4::black, false); + + // Render text on top + gGL.diffuseColor3f(1.f, 0.5f, 0.5f); + hud_render_text(str_x, camera_pos, *font, LLFontGL::NORMAL, -102.f, + (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), + false); + + gGL.diffuseColor3f(0.5f, 1.f, 0.5f); + hud_render_text(str_y, camera_pos, *font, LLFontGL::NORMAL, -27.f, + (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), + false); + + gGL.diffuseColor3f(0.5f, 0.5f, 1.f); + hud_render_text(str_z, camera_pos, *font, LLFontGL::NORMAL, 48.f, + (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), + false); + } +#else + gGL.pushMatrix(); + { + gViewerWindowp->setup2DRender(); + + const LLVector2& display_scale = gViewerWindowp->getDisplayScale(); + gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); + gGL.color4f(0.f, 0.f, 0.f, 0.7f); rounded_square->draw(window_center_x - 115, center_y - PAD, 235, PAD * 2 + 10, LLColor4(0.f, 0.f, 0.f, 0.7f)); @@ -495,34 +550,32 @@ // Render drop shadowed text (manually because of bigger 'distance') F32 right_x; - LLWString str_x = utf8str_to_wstring(llformat("X: %.3f", vec.mV[VX])); font->render(str_x, 0, window_center_x - 101, center_y - 2, LLColor4::black, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, S32_MAX, 1000, &right_x); - LLWString str_y = utf8str_to_wstring(llformat("Y: %.3f", vec.mV[VY])); font->render(str_y, 0, window_center_x - 26, center_y - 2, LLColor4::black, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, S32_MAX, 1000, &right_x); - LLWString str_z = utf8str_to_wstring(llformat("Z: %.3f", vec.mV[VZ])); font->render(str_z, 0, window_center_x + 49, center_y - 2, LLColor4::black, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, S32_MAX, 1000, &right_x); + static const LLColor4 color_x(1.f, 0.5f, 0.5f, 1.f); + static const LLColor4 color_y(0.5f, 1.f, 0.5f, 1.f); + static const LLColor4 color_z(0.5f, 0.5f, 1.f, 1.f); + // Render text on top - font->render(str_x, 0, window_center_x - 102, center_y, - LLColor4(1.f, 0.5f, 0.5f, 1.f), + font->render(str_x, 0, window_center_x - 102, center_y, color_x, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, S32_MAX, 1000, &right_x); - font->render(str_y, 0, window_center_x - 27, center_y, - LLColor4(0.5f, 1.f, 0.5f, 1.f), + font->render(str_y, 0, window_center_x - 27, center_y, color_y, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, S32_MAX, 1000, &right_x); - font->render(str_z, 0, window_center_x + 48, center_y, - LLColor4(0.5f, 0.5f, 1.f, 1.f), + font->render(str_z, 0, window_center_x + 48, center_y, color_z, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, S32_MAX, 1000, &right_x); } @@ -530,6 +583,7 @@ gGL.popMatrix(); gViewerWindowp->setup3DRender(); +#endif } void LLManip::renderTickText(const LLVector3& pos, const std::string& text,
| |