From 644c5cadbf8a0ab3ea7c2137e8819220a010c93f Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 10 Feb 2010 12:04:03 -0800 Subject: Name tags of friends appear in green. Refactored LLVOAvatar idleUpdateNameTag into smaller functions Eliminated unused LLHUDText::setUsePixelSize --- indra/newview/llhudtext.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llhudtext.h') diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index dc14a8c764..5d88b5d6ab 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -99,7 +99,6 @@ public: void setDropShadow(const BOOL do_shadow); void setFont(const LLFontGL* font); void setColor(const LLColor4 &color); - void setUsePixelSize(const BOOL use_pixel_size); void setZCompare(const BOOL zcompare); void setDoFade(const BOOL do_fade); void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } @@ -150,7 +149,6 @@ private: F32 mFadeRange; F32 mFadeDistance; F32 mLastDistance; - BOOL mUsePixelSize; BOOL mZCompare; BOOL mVisibleOffScreen; BOOL mOffscreen; -- cgit v1.2.3 From 36c35bca2663447216027015c10aa921ab75abfb Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 25 Feb 2010 17:06:17 -0800 Subject: Support multiple fonts, colors and styles in name tags Simplified LLHUDText string API to be UTF8 only Added per-text segment font support Changed LLVOAvatar invalidateNameTag to clearNameTag --- indra/newview/llhudtext.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'indra/newview/llhudtext.h') diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 5d88b5d6ab..f7248ceffc 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -34,7 +34,7 @@ #define LL_LLHUDTEXT_H #include "llpointer.h" -#include "lldarrayptr.h" +//#include "lldarrayptr.h" #include "llhudobject.h" #include "v4color.h" @@ -45,7 +45,7 @@ #include "llfontgl.h" #include #include -#include "lldarray.h" +//#include "lldarray.h" // Renders a 2D text billboard floating at the location specified. class LLDrawable; @@ -62,14 +62,19 @@ protected: class LLHUDTextSegment { public: - LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color) - : mColor(color), mStyle(style), mText(text) {} + LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) + : mColor(color), + mStyle(style), + mText(text), + mFont(font) + {} F32 getWidth(const LLFontGL* font); - const LLWString& getText() const { return mText; }; + const LLWString& getText() const { return mText; } void clearFontWidthMap() { mFontWidthMap.clear(); } LLColor4 mColor; LLFontGL::StyleFlags mStyle; + const LLFontGL* mFont; private: LLWString mText; std::map mFontWidthMap; @@ -89,16 +94,18 @@ public: } EVertAlignment; public: - void setStringUTF8(const std::string &utf8string); - void setString(const LLWString &wstring); + void setString(const std::string& text_utf8); +// void setString(const LLWString &wstring); void clearString(); - void addLine(const std::string &text, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL); - void addLine(const LLWString &wtext, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL); - void setLabel(const std::string &label); - void setLabel(const LLWString &label); + void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); +// void addLine(const LLWString &wtext, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); + void setLabel(const std::string& label_utf8); +// void setLabel(const LLWString &label); + void addLabel(const std::string& label_utf8); void setDropShadow(const BOOL do_shadow); void setFont(const LLFontGL* font); void setColor(const LLColor4 &color); + void setAlpha(F32 alpha); void setZCompare(const BOOL zcompare); void setDoFade(const BOOL do_fade); void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } -- cgit v1.2.3 From a235f3d5ea734db03a1a64901c893016f0320f18 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 26 Feb 2010 16:58:29 -0800 Subject: Clean out some dead code --- indra/newview/llhudtext.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llhudtext.h') diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index f7248ceffc..8219358cc1 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -34,7 +34,6 @@ #define LL_LLHUDTEXT_H #include "llpointer.h" -//#include "lldarrayptr.h" #include "llhudobject.h" #include "v4color.h" @@ -45,7 +44,6 @@ #include "llfontgl.h" #include #include -//#include "lldarray.h" // Renders a 2D text billboard floating at the location specified. class LLDrawable; -- cgit v1.2.3 From 717a4800f1ae0ae6ea0bbe9ed0af21c7851f5d0a Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 9 Mar 2010 14:28:48 -0800 Subject: Break name tag code out into LLHUDNameTag Start by duplicating the LLHUDText code, then stripping out functionality that only needs to exist in one place (like force-based juggling of name tag positions) --- indra/newview/llhudtext.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'indra/newview/llhudtext.h') diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 8219358cc1..3acd2934e1 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -92,15 +92,17 @@ public: } EVertAlignment; public: + // Set entire string, eliminating existing lines void setString(const std::string& text_utf8); -// void setString(const LLWString &wstring); + void clearString(); + + // Add text a line at a time, allowing custom formatting void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); -// void addLine(const LLWString &wtext, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); - void setLabel(const std::string& label_utf8); -// void setLabel(const LLWString &label); - void addLabel(const std::string& label_utf8); + void setDropShadow(const BOOL do_shadow); + + // Sets the default font for lines with no font specified void setFont(const LLFontGL* font); void setColor(const LLColor4 &color); void setAlpha(F32 alpha); @@ -120,7 +122,6 @@ public: /*virtual*/ void markDead(); friend class LLHUDObject; /*virtual*/ F32 getDistance() const { return mLastDistance; } - void setUseBubble(BOOL use_bubble) { mUseBubble = use_bubble; } S32 getLOD() { return mLOD; } BOOL getVisible() { return mVisible; } BOOL getHidden() const { return mHidden; } @@ -128,13 +129,11 @@ public: void setOnHUDAttachment(BOOL on_hud) { mOnHUDAttachment = on_hud; } void shift(const LLVector3& offset); - BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, LLVector3& intersection, BOOL debug_render = FALSE); - static void shiftAll(const LLVector3& offset); static void renderAllHUD(); - static void addPickable(std::set &pick_list); static void reshape(); static void setDisplayText(BOOL flag) { sDisplayText = flag ; } + protected: LLHUDText(const U8 type); @@ -147,8 +146,8 @@ protected: private: ~LLHUDText(); - BOOL mOnHUD; - BOOL mUseBubble; + BOOL mOnHUDAttachment; +// BOOL mUseBubble; BOOL mDropShadow; BOOL mDoFade; F32 mFadeRange; -- cgit v1.2.3 From 7337b4b05bf2218796742a0ee1ddb0fdf27236c4 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 9 Mar 2010 15:23:16 -0800 Subject: More harmonization of LLHUDNameTag vs. LLHUDText Eliminating now-unused code from LLHUDText --- indra/newview/llhudtext.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llhudtext.h') diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 3acd2934e1..023c7d8ff3 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -40,7 +40,6 @@ #include "v4coloru.h" #include "v2math.h" #include "llrect.h" -#include "llframetimer.h" #include "llfontgl.h" #include #include @@ -100,8 +99,6 @@ public: // Add text a line at a time, allowing custom formatting void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); - void setDropShadow(const BOOL do_shadow); - // Sets the default font for lines with no font specified void setFont(const LLFontGL* font); void setColor(const LLColor4 &color); @@ -122,7 +119,6 @@ public: /*virtual*/ void markDead(); friend class LLHUDObject; /*virtual*/ F32 getDistance() const { return mLastDistance; } - S32 getLOD() { return mLOD; } BOOL getVisible() { return mVisible; } BOOL getHidden() const { return mHidden; } void setHidden( BOOL hide ) { mHidden = hide; } @@ -141,14 +137,11 @@ protected: /*virtual*/ void renderForSelect(); void renderText(BOOL for_select); static void updateAll(); - void setLOD(S32 lod); S32 getMaxLines(); private: ~LLHUDText(); BOOL mOnHUDAttachment; -// BOOL mUseBubble; - BOOL mDropShadow; BOOL mDoFade; F32 mFadeRange; F32 mFadeDistance; @@ -172,11 +165,8 @@ private: S32 mOffsetY; F32 mRadius; std::vector mTextSegments; - std::vector mLabelSegments; - LLFrameTimer mResizeTimer; ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; - S32 mLOD; BOOL mHidden; static BOOL sDisplayText ; -- cgit v1.2.3 From 8527463c157021bdbda8c1eff18c659f3cd37037 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 9 Mar 2010 16:44:34 -0800 Subject: More name-tag vs. hud-text cleanup --- indra/newview/llhudtext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llhudtext.h') diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 023c7d8ff3..27b8f07cca 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -105,7 +105,7 @@ public: void setAlpha(F32 alpha); void setZCompare(const BOOL zcompare); void setDoFade(const BOOL do_fade); - void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } +// void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } // mMaxLines of -1 means unlimited lines. void setMaxLines(S32 max_lines) { mMaxLines = max_lines; } @@ -147,7 +147,7 @@ private: F32 mFadeDistance; F32 mLastDistance; BOOL mZCompare; - BOOL mVisibleOffScreen; +// BOOL mVisibleOffScreen; BOOL mOffscreen; LLColor4 mColor; LLVector3 mScale; -- cgit v1.2.3