diff options
author | Tom Grimshaw | 2010-05-24 21:55:46 +0100 |
---|---|---|
committer | Jacek Antonelli | 2010-06-19 02:42:59 -0500 |
commit | 006ab5e9e1dbe1b925c50afe53afb9e2965838f5 (patch) | |
tree | d437c9e6f9804d5e8ccad960a210ce832f7163d8 /linden/indra/newview/llhudeffectlookat.cpp | |
parent | Make "Show Look At" a persistent setting (Ported from Emerald, full credit du... (diff) | |
download | meta-impy-006ab5e9e1dbe1b925c50afe53afb9e2965838f5.zip meta-impy-006ab5e9e1dbe1b925c50afe53afb9e2965838f5.tar.gz meta-impy-006ab5e9e1dbe1b925c50afe53afb9e2965838f5.tar.bz2 meta-impy-006ab5e9e1dbe1b925c50afe53afb9e2965838f5.tar.xz |
Show names above the "look at" beacons. Ported from Emerald, full credit to them.
Diffstat (limited to 'linden/indra/newview/llhudeffectlookat.cpp')
-rw-r--r-- | linden/indra/newview/llhudeffectlookat.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 00bff21..99328f1 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "llviewerprecompiledheaders.h" | 33 | #include "llviewerprecompiledheaders.h" |
34 | 34 | ||
35 | #include "llhudeffectlookat.h" | 35 | #include "llhudeffectlookat.h" |
36 | #include "llhudrender.h" | ||
36 | 37 | ||
37 | #include "llrender.h" | 38 | #include "llrender.h" |
38 | 39 | ||
@@ -41,10 +42,11 @@ | |||
41 | #include "llvoavatar.h" | 42 | #include "llvoavatar.h" |
42 | #include "lldrawable.h" | 43 | #include "lldrawable.h" |
43 | #include "llviewerobjectlist.h" | 44 | #include "llviewerobjectlist.h" |
45 | #include "llviewerwindow.h" | ||
44 | #include "llrendersphere.h" | 46 | #include "llrendersphere.h" |
45 | #include "llselectmgr.h" | 47 | #include "llselectmgr.h" |
46 | #include "llglheaders.h" | 48 | #include "llglheaders.h" |
47 | 49 | #include "llresmgr.h" | |
48 | 50 | ||
49 | #include "llxmltree.h" | 51 | #include "llxmltree.h" |
50 | 52 | ||
@@ -545,6 +547,38 @@ void LLHUDEffectLookAt::render() | |||
545 | gGL.vertex3f(0.f, 0.f, 1.f); | 547 | gGL.vertex3f(0.f, 0.f, 1.f); |
546 | } gGL.end(); | 548 | } gGL.end(); |
547 | gGL.popMatrix(); | 549 | gGL.popMatrix(); |
550 | |||
551 | if( gSavedSettings.getBOOL("ShowLookAtNames") ) | ||
552 | { | ||
553 | const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); | ||
554 | LLGLEnable color_mat(GL_COLOR_MATERIAL); | ||
555 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); | ||
556 | LLGLState gls_blend(GL_BLEND, TRUE); | ||
557 | LLGLState gls_alpha(GL_ALPHA_TEST, TRUE); | ||
558 | glColor4f(1.0f, 1.0f, 1.0f, 1.0f); | ||
559 | gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); | ||
560 | gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); | ||
561 | |||
562 | // Well.. after that nasty complex try at somehow getting it to work initialising all sorts of stuff | ||
563 | // It seems to work and fix the previous bug of merely displaying untextured cubes, | ||
564 | // probably due to the helpful getTexUnit->enable. - Nexii | ||
565 | glMatrixMode(GL_MODELVIEW); | ||
566 | glPushMatrix(); | ||
567 | LLVector3 render_pos = target + LLVector3( 0.f, 0.f, 0.25f ); | ||
568 | LLColor4 Color = LLColor4( (*mAttentions)[mTargetType].mColor, 1.0f ); | ||
569 | std::string text = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->getFullname(); | ||
570 | |||
571 | // Show anonyms in place of actual names when @shownames=n restricted | ||
572 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
573 | { | ||
574 | text = gRlvHandler.getAnonym(text); | ||
575 | } | ||
576 | |||
577 | gViewerWindow->setupViewport(); | ||
578 | hud_render_utf8text(text, render_pos, *fontp, LLFontGL::NORMAL, -0.5f * fontp->getWidthF32(text), 3.f, Color, FALSE ); | ||
579 | |||
580 | glPopMatrix(); | ||
581 | } | ||
548 | } | 582 | } |
549 | } | 583 | } |
550 | 584 | ||