diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
commit | 9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (patch) | |
tree | 4a505c1e0919af52800b3ffb3eaf135e7d6f9ce6 /indra/newview/llhudrender.cpp | |
parent | 351ebe9fcb76f3b99c2957004bb8493a904869ee (diff) |
merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
Diffstat (limited to 'indra/newview/llhudrender.cpp')
-rw-r--r-- | indra/newview/llhudrender.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 95b8442ec7..fe65a12c47 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -47,17 +47,19 @@ void hud_render_utf8text(const std::string &str, const LLVector3 &pos_agent, const LLFontGL &font, const U8 style, + const LLFontGL::ShadowType shadow, const F32 x_offset, const F32 y_offset, const LLColor4& color, const BOOL orthographic) { LLWString wstr(utf8str_to_wstring(str)); - hud_render_text(wstr, pos_agent, font, style, x_offset, y_offset, color, orthographic); + hud_render_text(wstr, pos_agent, font, style, shadow, x_offset, y_offset, color, orthographic); } void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, const LLFontGL &font, const U8 style, + const LLFontGL::ShadowType shadow, const F32 x_offset, const F32 y_offset, const LLColor4& color, const BOOL orthographic) @@ -75,8 +77,8 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, LLVector3 up_axis; if (orthographic) { - right_axis.setVec(0.f, -1.f / gViewerWindow->getWindowHeight(), 0.f); - up_axis.setVec(0.f, 0.f, 1.f / gViewerWindow->getWindowHeight()); + right_axis.setVec(0.f, -1.f / gViewerWindow->getWorldViewWidth(), 0.f); + up_axis.setVec(0.f, 0.f, 1.f / gViewerWindow->getWorldViewHeight()); } else { @@ -104,26 +106,36 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, //get the render_pos in screen space F64 winX, winY, winZ; + LLRect world_view_rect = gViewerWindow->getWorldViewRect(); + S32 viewport[4]; + viewport[0] = world_view_rect.mLeft; + viewport[1] = world_view_rect.mBottom; + viewport[2] = world_view_rect.getWidth(); + viewport[3] = world_view_rect.getHeight(); gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2], - gGLModelView, gGLProjection, (GLint*) gGLViewport, + gGLModelView, gGLProjection, (GLint*) viewport, &winX, &winY, &winZ); - //fonts all render orthographically, set up projection + //fonts all render orthographically, set up projection`` glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); LLUI::pushMatrix(); - gViewerWindow->setup2DRender(); + gl_state_for_2d(world_view_rect.getWidth(), world_view_rect.getHeight()); + gViewerWindow->setup3DViewport(); + //gViewerWindow->setup2DRender(); + winX -= world_view_rect.mLeft; + winY -= world_view_rect.mBottom; LLUI::loadIdentity(); LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f)); //glRotatef(angle * RAD_TO_DEG, axis.mV[VX], axis.mV[VY], axis.mV[VZ]); //glScalef(right_scale, up_scale, 1.f); F32 right_x; - font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, wstr.length(), 1000, &right_x); + font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, wstr.length(), 1000, &right_x); LLUI::popMatrix(); glMatrixMode(GL_PROJECTION); |