diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 08:40:49 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 08:40:49 -0400 |
commit | 22a47eee84dbaa5c731c000c6013ca558bd15892 (patch) | |
tree | 8b3128fdb91731d95025b86701431826c441c5ba /indra/newview/llvoavatarself.cpp | |
parent | a6b85244a6f943a4598ff9b7b8a3343eb1e0d11e (diff) | |
parent | 7ac4c3b56e5246fceaa73e7c9c665d3c04827d6c (diff) |
Merge branch 'release/luau-scripting' into lua-resultset
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 195 |
1 files changed, 100 insertions, 95 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0a13b7d309..e4a7b53d9f 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -78,7 +78,7 @@ LLPointer<LLVOAvatarSelf> gAgentAvatarp = NULL; -BOOL isAgentAvatarValid() +bool isAgentAvatarValid() { return (gAgentAvatarp.notNull() && gAgentAvatarp->isValid()); } @@ -172,7 +172,7 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, mInitialMetric(true), mMetricSequence(0) { - mMotionController.mIsSelf = TRUE; + mMotionController.mIsSelf = true; LL_DEBUGS() << "Marking avatar as self " << id << LL_ENDL; } @@ -200,7 +200,7 @@ bool update_avatar_rez_metrics() void LLVOAvatarSelf::initInstance() { - BOOL status = TRUE; + bool status = true; // creates hud joint(mScreen) among other things status &= loadAvatarSelf(); @@ -300,12 +300,12 @@ void LLVOAvatarSelf::markDead() LLVOAvatar::markDead(); } -/*virtual*/ BOOL LLVOAvatarSelf::loadAvatar() +/*virtual*/ bool LLVOAvatarSelf::loadAvatar() { - BOOL success = LLVOAvatar::loadAvatar(); + bool success = LLVOAvatar::loadAvatar(); // set all parameters stored directly in the avatar to have - // the isSelfParam to be TRUE - this is used to prevent + // the isSelfParam to be true - this is used to prevent // them from being animated or trigger accidental rebakes // when we copy params from the wearable to the base avatar. for (LLViewerVisualParam* param = (LLViewerVisualParam*) getFirstVisualParam(); @@ -314,7 +314,7 @@ void LLVOAvatarSelf::markDead() { if (param->getWearableType() != LLWearableType::WT_INVALID) { - param->setIsDummy(TRUE); + param->setIsDummy(true); } } @@ -322,20 +322,20 @@ void LLVOAvatarSelf::markDead() } -BOOL LLVOAvatarSelf::loadAvatarSelf() +bool LLVOAvatarSelf::loadAvatarSelf() { - BOOL success = TRUE; + bool success = true; // avatar_skeleton.xml if (!buildSkeletonSelf(sAvatarSkeletonInfo)) { LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL; - return FALSE; + return false; } return success; } -BOOL LLVOAvatarSelf::buildSkeletonSelf(const LLAvatarSkeletonInfo *info) +bool LLVOAvatarSelf::buildSkeletonSelf(const LLAvatarSkeletonInfo *info) { // add special-purpose "screen" joint mScreenp = new LLViewerJoint("mScreen", NULL); @@ -347,11 +347,11 @@ BOOL LLVOAvatarSelf::buildSkeletonSelf(const LLAvatarSkeletonInfo *info) // SL-315 mScreenp->setWorldPosition(LLVector3::zero); // need to update screen agressively when sidebar opens/closes, for example - mScreenp->mUpdateXform = TRUE; - return TRUE; + mScreenp->mUpdateXform = true; + return true; } -BOOL LLVOAvatarSelf::buildMenus() +bool LLVOAvatarSelf::buildMenus() { //------------------------------------------------------------------------- // build the attach and detach menus @@ -652,7 +652,7 @@ BOOL LLVOAvatarSelf::buildMenus() } } } - return TRUE; + return true; } void LLVOAvatarSelf::cleanup() @@ -691,7 +691,7 @@ bool LLVOAvatarSelf::updateCharacter(LLAgent &agent) } // virtual -BOOL LLVOAvatarSelf::isValid() const +bool LLVOAvatarSelf::isValid() const { return ((getRegion() != NULL) && !isDead()); } @@ -727,39 +727,39 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) +bool LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) { if (!which_param) { - return FALSE; + return false; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(which_param->getID()); return setParamWeight(param,weight); } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) +bool LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) { if (!param_name) { - return FALSE; + return false; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(param_name); return setParamWeight(param,weight); } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight) +bool LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight) { LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(index); return setParamWeight(param,weight); } -BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight) +bool LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight) { if (!param) { - return FALSE; + return false; } if (param->getCrossWearable()) @@ -845,7 +845,7 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id) LLViewerObject* object = gObjectList.findObject(source_id); if (object) { - object->setFlagsWithoutUpdate(FLAGS_ANIM_SOURCE, FALSE); + object->setFlagsWithoutUpdate(FLAGS_ANIM_SOURCE, false); } } @@ -874,7 +874,7 @@ void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index) //virtual void LLVOAvatarSelf::removeMissingBakedTextures() { - BOOL removed = FALSE; + bool removed = false; for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { const S32 te = mBakedTextureDatas[i].mTextureIndex; @@ -889,7 +889,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures() if (imagep && imagep != tex) { setTEImage(te, imagep); - removed = TRUE; + removed = true; } } } @@ -899,7 +899,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures() for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { LLViewerTexLayerSet *layerset = getTexLayerSet(i); - layerset->setUpdatesEnabled(TRUE); + layerset->setUpdatesEnabled(true); invalidateComposite(layerset); } updateMeshTextures(); @@ -1024,7 +1024,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam() if (mBeamTimer.getElapsedTimeF32() > 0.25f) { mBeam->setColor(LLColor4U(gAgent.getEffectColor())); - mBeam->setNeedsSendToSim(TRUE); + mBeam->setNeedsSendToSim(true); mBeamTimer.reset(); } } @@ -1037,7 +1037,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam() void LLVOAvatarSelf::restoreMeshData() { //LL_INFOS() << "Restoring" << LL_ENDL; - mMeshValid = TRUE; + mMeshValid = true; updateJointLODs(); updateAttachmentVisibility(gAgentCamera.getCameraMode()); @@ -1059,7 +1059,7 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) LLViewerJointAttachment* attachment = iter->second; if (attachment->getIsHUDAttachment()) { - attachment->setAttachmentVisibility(TRUE); + attachment->setAttachmentVisibility(true); } else { @@ -1068,15 +1068,15 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) case CAMERA_MODE_MOUSELOOK: if ((LLVOAvatar::sVisibleInFirstPerson && attachment->getVisibleInFirstPerson()) || gPipeline.mHeroProbeManager.isMirrorPass()) { - attachment->setAttachmentVisibility(TRUE); + attachment->setAttachmentVisibility(true); } else { - attachment->setAttachmentVisibility(FALSE); + attachment->setAttachmentVisibility(false); } break; default: - attachment->setAttachmentVisibility(TRUE); + attachment->setAttachmentVisibility(true); break; } } @@ -1086,7 +1086,7 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) //----------------------------------------------------------------------------- // updatedWearable( LLWearableType::EType type ) // forces an update to any baked textures relevant to type. -// will force an upload of the resulting bake if the second parameter is TRUE +// will force an upload of the resulting bake if the second parameter is true //----------------------------------------------------------------------------- void LLVOAvatarSelf::wearableUpdated(LLWearableType::EType type) { @@ -1122,7 +1122,7 @@ void LLVOAvatarSelf::wearableUpdated(LLWearableType::EType type) //----------------------------------------------------------------------------- // isWearingAttachment() //----------------------------------------------------------------------------- -BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const +bool LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const { const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id); for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); @@ -1132,10 +1132,10 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const const LLViewerJointAttachment* attachment = iter->second; if (attachment->getAttachedObject(base_inv_item_id)) { - return TRUE; + return true; } } - return FALSE; + return false; } //----------------------------------------------------------------------------- @@ -1212,7 +1212,7 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view } //virtual -BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) +bool LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) { const LLUUID attachment_id = viewer_object->getAttachmentItemID(); if ( LLVOAvatar::detachObject(viewer_object) ) @@ -1220,7 +1220,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) // the simulator should automatically handle permission revocation stopMotionFromSource(attachment_id); - LLFollowCamMgr::getInstance()->setCameraActive(viewer_object->getID(), FALSE); + LLFollowCamMgr::getInstance()->setCameraActive(viewer_object->getID(), false); LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); @@ -1232,7 +1232,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) // permissions revocation stopMotionFromSource(child_objectp->getID()); - LLFollowCamMgr::getInstance()->setCameraActive(child_objectp->getID(), FALSE); + LLFollowCamMgr::getInstance()->setCameraActive(child_objectp->getID(), false); } // Make sure the inventory is in sync with the avatar. @@ -1247,9 +1247,9 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) LLAppearanceMgr::instance().unregisterAttachment(attachment_id); } - return TRUE; + return true; } - return FALSE; + return false; } bool LLVOAvatarSelf::hasAttachmentsInTrash() @@ -1274,7 +1274,7 @@ bool LLVOAvatarSelf::hasAttachmentsInTrash() } // static -BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) +bool LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) { LLInventoryItem* item = gInventory.getItem(item_id); if (item) @@ -1303,9 +1303,9 @@ BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) LLAppearanceMgr::instance().removeCOFItemLinks(item_id); } } - return TRUE; + return true; } - return FALSE; + return false; } U32 LLVOAvatarSelf::getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const @@ -1315,7 +1315,7 @@ U32 LLVOAvatarSelf::getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) } // virtual -void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src_raw, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +void LLVOAvatarSelf::localTextureLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src_raw, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata) { const LLUUID& src_id = src_vi->getID(); @@ -1364,20 +1364,20 @@ void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *sr } // virtual -BOOL LLVOAvatarSelf::getLocalTextureGL(ETextureIndex type, LLViewerTexture** tex_pp, U32 index) const +bool LLVOAvatarSelf::getLocalTextureGL(ETextureIndex type, LLViewerTexture** tex_pp, U32 index) const { *tex_pp = NULL; - if (!isIndexLocalTexture(type)) return FALSE; - if (getLocalTextureID(type, index) == IMG_DEFAULT_AVATAR) return TRUE; + if (!isIndexLocalTexture(type)) return false; + if (getLocalTextureID(type, index) == IMG_DEFAULT_AVATAR) return true; const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(type, index); if (!local_tex_obj) { - return FALSE; + return false; } *tex_pp = dynamic_cast<LLViewerTexture*> (local_tex_obj->getImage()); - return TRUE; + return true; } LLViewerFetchedTexture* LLVOAvatarSelf::getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const @@ -1417,7 +1417,7 @@ const LLUUID& LLVOAvatarSelf::getLocalTextureID(ETextureIndex type, U32 index) c // Returns true if at least the lowest quality discard level exists for every texture // in the layerset. //----------------------------------------------------------------------------- -BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const +bool LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const { /* if (layerset == mBakedTextureDatas[BAKED_HEAD].mTexLayerSet) return getLocalDiscardLevel(TEX_HEAD_BODYPAINT) >= 0; */ @@ -1428,7 +1428,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye const EBakedTextureIndex baked_index = baked_iter->first; if (layerset == mBakedTextureDatas[baked_index].mTexLayerSet) { - BOOL ret = true; + bool ret = true; const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second; for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); local_tex_iter != baked_dict->mLocalTextures.end(); @@ -1439,7 +1439,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++) { - BOOL tex_avail = (getLocalDiscardLevel(tex_index, wearable_index) >= 0); + bool tex_avail = (getLocalDiscardLevel(tex_index, wearable_index) >= 0); ret &= tex_avail; } } @@ -1447,7 +1447,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye } } llassert(0); - return FALSE; + return false; } //----------------------------------------------------------------------------- @@ -1456,7 +1456,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye // Returns true if the highest quality discard level exists for every texture // in the layerset. //----------------------------------------------------------------------------- -BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const +bool LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const { const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); // const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels. @@ -1479,19 +1479,19 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset if ((local_discard_level > (S32)(desired_tex_discard_level)) || (local_discard_level < 0 )) { - return FALSE; + return false; } } } - return TRUE; + return true; } } llassert(0); - return FALSE; + return false; } -BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const +bool LLVOAvatarSelf::isAllLocalTextureDataFinal() const { const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); // const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels @@ -1512,18 +1512,18 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const if ((local_discard_level > (S32)(desired_tex_discard_level)) || (local_discard_level < 0 )) { - return FALSE; + return false; } } } } - return TRUE; + return true; } -BOOL LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const +bool LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { LLUUID id; - BOOL isDefined = TRUE; + bool isDefined = true; if (isIndexLocalTexture(type)) { const LLWearableType::EType wearable_type = sAvatarDictionary->getTEWearableType(type); @@ -1553,7 +1553,7 @@ BOOL LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex t } //virtual -BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const +bool LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { if (isIndexBakedTexture(type)) { @@ -1566,7 +1566,7 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t } //virtual -BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const +bool LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const { if (isIndexBakedTexture(type)) { @@ -1581,7 +1581,7 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t else { LL_WARNS() << "Wearable not found" << LL_ENDL; - return FALSE; + return false; } } @@ -1648,7 +1648,7 @@ void LLVOAvatarSelf::setupComposites() for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex; - BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index)); + bool layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index)); LLViewerTexLayerSet *layerset = getTexLayerSet(i); if (layerset) { @@ -1673,7 +1673,7 @@ void LLVOAvatarSelf::updateComposites() // virtual S32 LLVOAvatarSelf::getLocalDiscardLevel(ETextureIndex type, U32 wearable_index) const { - if (!isIndexLocalTexture(type)) return FALSE; + if (!isIndexLocalTexture(type)) return false; const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(type, wearable_index); if (local_tex_obj) @@ -1724,11 +1724,11 @@ void LLVOAvatarSelf::getLocalTextureByteCount(S32* gl_bytes) const } // virtual -void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_tex, BOOL baked_version_ready, U32 index) +void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_tex, bool baked_version_ready, U32 index) { if (!isIndexLocalTexture(type)) return; - LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(src_tex, TRUE) ; + LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(src_tex, true) ; if(!tex) { return ; @@ -1789,7 +1789,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te } else { - tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, TRUE, FALSE, new LLAvatarTexData(getID(), type), NULL); + tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, true, false, new LLAvatarTexData(getID(), type), NULL); } } tex->setMinDiscardLevel(desired_discard); @@ -1801,7 +1801,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te } //virtual -void LLVOAvatarSelf::setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index) +void LLVOAvatarSelf::setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, bool baked_version_exists, U32 index) { if (!isIndexLocalTexture(type)) return; LLLocalTextureObject *local_tex_obj = getLocalTextureObject(type,index); @@ -1878,7 +1878,7 @@ void LLVOAvatarSelf::dumpLocalTextures() const // onLocalTextureLoaded() //----------------------------------------------------------------------------- -void LLVOAvatarSelf::onLocalTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src_raw, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +void LLVOAvatarSelf::onLocalTextureLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src_raw, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata) { LLAvatarTexData *data = (LLAvatarTexData *)userdata; LLVOAvatarSelf *self = (LLVOAvatarSelf *)gObjectList.findObject(data->mAvatarID); @@ -1898,7 +1898,7 @@ void LLVOAvatarSelf::onLocalTextureLoaded(BOOL success, LLViewerFetchedTexture * { if (isIndexLocalTexture((ETextureIndex)te)) { - setLocalTexture((ETextureIndex)te, imagep, FALSE ,index); + setLocalTexture((ETextureIndex)te, imagep, false ,index); } else { @@ -2017,7 +2017,7 @@ bool LLVOAvatarSelf::getIsCloud() const } /*static*/ -void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata) { if (gAgentAvatarp.notNull()) { @@ -2025,7 +2025,7 @@ void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTe } } -void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +void LLVOAvatarSelf::debugTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata) { LLAvatarTexData *data = (LLAvatarTexData *)userdata; if (!data) @@ -2050,7 +2050,7 @@ void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedText } } -void LLVOAvatarSelf::debugBakedTextureUpload(EBakedTextureIndex index, BOOL finished) +void LLVOAvatarSelf::debugBakedTextureUpload(EBakedTextureIndex index, bool finished) { U32 done = 0; if (finished) @@ -2189,7 +2189,7 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = sAvatarDictionary->getBakedTexture((EBakedTextureIndex)i); - BOOL is_texture_final = TRUE; + bool is_texture_final = true; for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); local_tex_iter != baked_dict->mLocalTextures.end(); ++local_tex_iter) @@ -2230,16 +2230,21 @@ void LLVOAvatarSelf::appearanceChangeMetricsCoro(std::string url) // Status of our own rezzing. msg["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); + msg["first_decloud_time"] = getFirstDecloudTime(); // Status of all nearby avs including ourself. msg["nearby"] = LLSD::emptyArray(); std::vector<S32> rez_counts; - LLVOAvatar::getNearbyRezzedStats(rez_counts); + F32 avg_time; + S32 total_cloud_avatars; + LLVOAvatar::getNearbyRezzedStats(rez_counts, avg_time, total_cloud_avatars); for (S32 rez_stat = 0; rez_stat < rez_counts.size(); ++rez_stat) { std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat); msg["nearby"][rez_status_name] = rez_counts[rez_stat]; } + msg["nearby"]["avg_decloud_time"] = avg_time; + msg["nearby"]["cloud_total"] = total_cloud_avatars; // std::vector<std::string> bucket_fields("timer_name","is_self","grid_x","grid_y","is_using_server_bake"); std::vector<std::string> by_fields; @@ -2385,22 +2390,22 @@ const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) c return LLUUID::null; } -BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const +bool LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const { ETextureIndex tex_index = sAvatarDictionary->bakedToLocalTextureIndex(baked_index); if (tex_index == TEX_NUM_INDICES) { - return FALSE; + return false; } // Check if the texture hasn't been baked yet. if (!isTextureDefined(tex_index, 0)) { LL_DEBUGS() << "getTEImage( " << (U32) tex_index << " )->getID() == IMG_DEFAULT_AVATAR" << LL_ENDL; - return FALSE; + return false; } if (gAgent.isGodlikeWithoutAdminMenuFakery()) - return TRUE; + return true; // Check permissions of textures that show up in the // baked texture. We don't want people copying people's @@ -2435,7 +2440,7 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const LLInventoryModel::INCLUDE_TRASH, asset_id_matches); - BOOL can_grab = FALSE; + bool can_grab = false; LL_DEBUGS() << "item count for asset " << texture_id << ": " << items.size() << LL_ENDL; if (items.size()) { @@ -2445,22 +2450,22 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const LLViewerInventoryItem* itemp = items[i]; if (itemp->getIsFullPerm()) { - can_grab = TRUE; + can_grab = true; break; } } } - if (!can_grab) return FALSE; + if (!can_grab) return false; } } } } - return TRUE; + return true; } void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTexture* imagep, - F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked) + F32 texel_area_ratio, bool render_avatar, bool covered_by_baked) { if (!isIndexLocalTexture(type)) return; @@ -2485,14 +2490,14 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe imagep->forceUpdateBindStats() ; if (imagep->getDiscardLevel() < 0) { - mHasGrey = TRUE; // for statistics gathering + mHasGrey = true; // for statistics gathering } } } else { // texture asset is missing - mHasGrey = TRUE; // for statistics gathering + mHasGrey = true; // for statistics gathering } } } @@ -2614,7 +2619,7 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) { if (slam_for_debug) { - layer_set->setUpdatesEnabled(TRUE); + layer_set->setUpdatesEnabled(true); } invalidateComposite(layer_set); @@ -2819,18 +2824,18 @@ void LLVOAvatarSelf::setHoverOffset(const LLVector3& hover_offset, bool send_upd //------------------------------------------------------------------------ // needsRenderBeam() //------------------------------------------------------------------------ -BOOL LLVOAvatarSelf::needsRenderBeam() +bool LLVOAvatarSelf::needsRenderBeam() { LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - BOOL is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing()); + bool is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing()); LLViewerObject* objp = LLToolGrab::getInstance()->getEditingObject(); if (objp // might need to be "!objp ||" instead of "objp &&". && (objp->isAttachment() || objp->isAvatar())) { // don't render grab tool's selection beam on hud objects, // attachments or avatars - is_touching_or_grabbing = FALSE; + is_touching_or_grabbing = false; } return is_touching_or_grabbing || (getAttachmentState() & AGENT_STATE_EDITING && LLSelectMgr::getInstance()->shouldShowSelection()); } |