diff options
author | RunitaiLinden <davep@lindenlab.com> | 2024-05-06 16:48:58 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2024-05-06 16:48:58 -0500 |
commit | c6d752b880cacca8fb8f10f28790a50161fcb9ab (patch) | |
tree | 14910a69597962134f2e78e864a2f05962a16356 /indra/newview/llhudeffectlookat.cpp | |
parent | 76101843c0d390c25a783f212eb1ea75e508ada4 (diff) | |
parent | 7d87e41bbd5d4761b1eb17e49b7a00b948d84213 (diff) |
Merge remote-tracking branch 'origin/DRTVWR-600-maint-A' into gltf-dev-maint-a-merge
Diffstat (limited to 'indra/newview/llhudeffectlookat.cpp')
-rw-r--r-- | indra/newview/llhudeffectlookat.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 0f230067bc..10ac42a7a0 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -42,7 +42,7 @@ #include "llxmltree.h" -BOOL LLHUDEffectLookAt::sDebugLookAt = FALSE; +bool LLHUDEffectLookAt::sDebugLookAt = false; // packet layout const S32 SOURCE_AVATAR = 0; @@ -138,11 +138,11 @@ static LLAttentionSet gGirlAttentions(GIRL_ATTS); -static BOOL loadGender(LLXmlTreeNode* gender) +static bool loadGender(LLXmlTreeNode* gender) { if( !gender) { - return FALSE; + return false; } std::string str; gender->getAttributeString("name", str); @@ -162,7 +162,7 @@ static BOOL loadGender(LLXmlTreeNode* gender) else if(str == "select") attention = &attentions[LOOKAT_TARGET_SELECT]; else if(str == "focus") attention = &attentions[LOOKAT_TARGET_FOCUS]; else if(str == "mouselook") attention = &attentions[LOOKAT_TARGET_MOUSELOOK]; - else return FALSE; + else return false; F32 priority, timeout; attention_node->getAttributeF32("priority", priority); @@ -171,30 +171,30 @@ static BOOL loadGender(LLXmlTreeNode* gender) attention->mPriority = priority; attention->mTimeout = timeout; } - return TRUE; + return true; } -static BOOL loadAttentions() +static bool loadAttentions() { - static BOOL first_time = TRUE; + static bool first_time = true; if( ! first_time) { - return TRUE; // maybe not ideal but otherwise it can continue to fail forever. + return true; // maybe not ideal but otherwise it can continue to fail forever. } - first_time = FALSE; + first_time = false; std::string filename; filename = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"attentions.xml"); LLXmlTree xml_tree; - BOOL success = xml_tree.parseFile( filename, FALSE ); + bool success = xml_tree.parseFile( filename, false ); if( !success ) { - return FALSE; + return false; } LLXmlTreeNode* root = xml_tree.getRoot(); if( !root ) { - return FALSE; + return false; } //------------------------------------------------------------------------- @@ -203,7 +203,7 @@ static BOOL loadAttentions() if( !root->hasName( "linden_attentions" ) ) { LL_WARNS() << "Invalid linden_attentions file header: " << filename << LL_ENDL; - return FALSE; + return false; } std::string version; @@ -211,7 +211,7 @@ static BOOL loadAttentions() if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") ) { LL_WARNS() << "Invalid linden_attentions file version: " << version << LL_ENDL; - return FALSE; + return false; } //------------------------------------------------------------------------- @@ -223,11 +223,11 @@ static BOOL loadAttentions() { if( !loadGender( child ) ) { - return FALSE; + return false; } } - return TRUE; + return true; } @@ -389,29 +389,29 @@ void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global) // setLookAt() // called by agent logic to set look at behavior locally, and propagate to sim //----------------------------------------------------------------------------- -BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) +bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) { if (!mSourceObject) { - return FALSE; + return false; } if (target_type >= LOOKAT_NUM_TARGETS) { LL_WARNS() << "Bad target_type " << (int)target_type << " - ignoring." << LL_ENDL; - return FALSE; + return false; } // must be same or higher priority than existing effect if ((*mAttentions)[target_type].mPriority < (*mAttentions)[mTargetType].mPriority) { - return FALSE; + return false; } F32 current_time = mTimer.getElapsedTimeF32(); // type of lookat behavior or target object has changed - BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); + bool lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); // lookat position has moved a certain amount and we haven't just sent an update lookAtChanged = lookAtChanged || ((dist_vec_squared(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && @@ -422,7 +422,7 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec mLastSentOffsetGlobal = position; F32 timeout = (*mAttentions)[target_type].mTimeout; setDuration(timeout); - setNeedsSendToSim(TRUE); + setNeedsSendToSim(true); } if (target_type == LOOKAT_TARGET_CLEAR) @@ -445,7 +445,7 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec update(); } - return TRUE; + return true; } //----------------------------------------------------------------------------- @@ -553,7 +553,7 @@ void LLHUDEffectLookAt::update() { clearLookAtTarget(); // look at timed out (only happens on own avatar), so tell everyone - setNeedsSendToSim(TRUE); + setNeedsSendToSim(true); } } @@ -610,7 +610,7 @@ bool LLHUDEffectLookAt::calcTargetPosition() { LLVOAvatar *target_av = (LLVOAvatar *)target_obj; - BOOL looking_at_self = source_avatar->isSelf() && target_av->isSelf(); + bool looking_at_self = source_avatar->isSelf() && target_av->isSelf(); // if selecting self, stare forward if (looking_at_self && mTargetOffsetGlobal.magVecSquared() < MIN_TARGET_OFFSET_SQUARED) |