From 70f8dc7a4f4be217fea5439e474fc75e567c23c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Sat, 10 Feb 2024 22:37:52 +0100 Subject: miscellaneous: BOOL (int) to real bool --- indra/newview/llvoavatarself.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatarself.h') diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 6384e2b844..a121ef356e 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -59,7 +59,7 @@ public: virtual void initInstance(); // Called after construction to initialize the class. void cleanup(); protected: - /*virtual*/ BOOL loadAvatar(); + /*virtual*/ bool loadAvatar(); BOOL loadAvatarSelf(); BOOL buildSkeletonSelf(const LLAvatarSkeletonInfo *info); BOOL buildMenus(); @@ -110,7 +110,7 @@ private: public: /*virtual*/ bool isSelf() const { return true; } - /*virtual*/ BOOL isValid() const; + /*virtual*/ bool isValid() const; //-------------------------------------------------------------------- // Updates @@ -180,7 +180,7 @@ public: BOOL isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; BOOL isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index - /*virtual*/ BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; + /*virtual*/ bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; -- cgit v1.2.3 From 9e854b697a06abed2a0917fb6120445f176764f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Fri, 16 Feb 2024 19:29:51 +0100 Subject: misc: BOOL to bool --- indra/newview/llvoavatarself.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatarself.h') diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index a121ef356e..c4a81affe6 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -92,9 +92,9 @@ public: /*virtual*/ void requestStopMotion(LLMotion* motion); /*virtual*/ LLJoint* getJoint(const std::string &name); - /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight); - /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight); - /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight); + /*virtual*/ bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight); + /*virtual*/ bool setVisualParamWeight(const char* param_name, F32 weight); + /*virtual*/ bool setVisualParamWeight(S32 index, F32 weight); /*virtual*/ void updateVisualParams(); void writeWearablesToAvatar(); /*virtual*/ void idleUpdateAppearanceAnimation(); -- cgit v1.2.3 From 60d3dd98a44230c21803c1606552ee098ed9fa7c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 21 Feb 2024 21:05:14 +0100 Subject: Convert remaining BOOL to bool --- indra/newview/llvoavatarself.h | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'indra/newview/llvoavatarself.h') diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index c4a81affe6..c7b61edd1c 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -60,9 +60,9 @@ public: void cleanup(); protected: /*virtual*/ bool loadAvatar(); - BOOL loadAvatarSelf(); - BOOL buildSkeletonSelf(const LLAvatarSkeletonInfo *info); - BOOL buildMenus(); + bool loadAvatarSelf(); + bool buildSkeletonSelf(const LLAvatarSkeletonInfo *info); + bool buildMenus(); /** Initialization ** ** @@ -101,7 +101,7 @@ public: private: // helper function. Passed in param is assumed to be in avatar's parameter list. - BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight); + bool setParamWeight(const LLViewerVisualParam *param, F32 weight); /******************************************************************************** ** ** @@ -149,7 +149,7 @@ private: // Render beam //-------------------------------------------------------------------- protected: - BOOL needsRenderBeam(); + bool needsRenderBeam(); private: LLPointer mBeam; LLFrameTimer mBeamTimer; @@ -177,32 +177,32 @@ public: public: S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; bool areTexturesCurrent() const; - BOOL isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; - BOOL isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; + bool isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; + bool isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index /*virtual*/ bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; - /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; - /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; + /*virtual*/ bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; + /*virtual*/ bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; //-------------------------------------------------------------------- // Local Textures //-------------------------------------------------------------------- public: - BOOL getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture** image_gl_pp, U32 index) const; + bool getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture** image_gl_pp, U32 index) const; LLViewerFetchedTexture* getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; const LLUUID& getLocalTextureID(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; void setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index); - /*virtual*/ void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index); + /*virtual*/ void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture* tex, bool baked_version_exits, U32 index); protected: - /*virtual*/ void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index); - void localTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + /*virtual*/ void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, bool baked_version_exists, U32 index); + void localTextureLoaded(bool succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); void getLocalTextureByteCount(S32* gl_byte_count) const; - /*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked); + /*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, bool rendered, bool covered_by_baked); LLLocalTextureObject* getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 index) const; private: - static void onLocalTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + static void onLocalTextureLoaded(bool succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); /*virtual*/ void setImage(const U8 te, LLViewerTexture *imagep, const U32 index); /*virtual*/ LLViewerTexture* getImage(const U8 te, const U32 index) const; @@ -240,7 +240,7 @@ public: void updateComposites(); const LLUUID& grabBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; - BOOL canGrabBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; + bool canGrabBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; //-------------------------------------------------------------------- @@ -282,12 +282,12 @@ protected: //-------------------------------------------------------------------- public: void updateAttachmentVisibility(U32 camera_mode); - BOOL isWearingAttachment(const LLUUID& inv_item_id) const; + bool isWearingAttachment(const LLUUID& inv_item_id) const; LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const; /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); - /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); - static BOOL detachAttachmentIntoInventory(const LLUUID& item_id); + /*virtual*/ bool detachObject(LLViewerObject *viewer_object); + static bool detachAttachmentIntoInventory(const LLUUID& item_id); bool hasAttachmentsInTrash(); @@ -371,10 +371,10 @@ public: void outputRezDiagnostics() const; void outputRezTiming(const std::string& msg) const; void reportAvatarRezTime() const; - void debugBakedTextureUpload(LLAvatarAppearanceDefines::EBakedTextureIndex index, BOOL finished); - static void debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + void debugBakedTextureUpload(LLAvatarAppearanceDefines::EBakedTextureIndex index, bool finished); + static void debugOnTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); - BOOL isAllLocalTextureDataFinal() const; + bool isAllLocalTextureDataFinal() const; const LLViewerTexLayerSet* debugGetLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex index) const { return (LLViewerTexLayerSet*)(mBakedTextureDatas[index].mTexLayerSet); } const std::string verboseDebugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer @@ -388,7 +388,7 @@ private: F32 mDebugTimeAvatarVisible; F32 mDebugTextureLoadTimes[LLAvatarAppearanceDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level F32 mDebugBakedTextureTimes[LLAvatarAppearanceDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture - void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + void debugTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); void appearanceChangeMetricsCoro(std::string url); bool mInitialMetric; @@ -401,7 +401,7 @@ private: extern LLPointer gAgentAvatarp; -BOOL isAgentAvatarValid(); +bool isAgentAvatarValid(); void selfStartPhase(const std::string& phase_name); void selfStopPhase(const std::string& phase_name, bool err_check = true); -- cgit v1.2.3 From 6d6eabca44d08d5b97bfe3e941d2b9687c2246ea Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 20 May 2024 17:16:18 +0300 Subject: triage#59 Render Friends Only option An option for performance testing, video recording or taking photos, so that unexpected people won't appear in your photos or tests. --- indra/newview/llvoavatarself.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvoavatarself.h') diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index c7b61edd1c..46bac63d93 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -110,6 +110,7 @@ private: public: /*virtual*/ bool isSelf() const { return true; } + virtual bool isBuddy() const { return false; } /*virtual*/ bool isValid() const; //-------------------------------------------------------------------- -- cgit v1.2.3 From e2e37cced861b98de8c1a7c9c0d3a50d2d90e433 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 22 May 2024 21:25:21 +0200 Subject: Fix line endlings --- indra/newview/llvoavatarself.h | 822 ++++++++++++++++++++--------------------- 1 file changed, 411 insertions(+), 411 deletions(-) (limited to 'indra/newview/llvoavatarself.h') diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 4bc414785e..77556c8412 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -1,411 +1,411 @@ -/** - * @file llvoavatarself.h - * @brief Declaration of LLVOAvatar class which is a derivation fo - * LLViewerObject - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLVOAVATARSELF_H -#define LL_LLVOAVATARSELF_H - -#include "llviewertexture.h" -#include "llvoavatar.h" -#include -#include "lleventcoro.h" -#include "llcoros.h" - -struct LocalTextureData; -class LLInventoryCallback; - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// LLVOAvatarSelf -// -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLVOAvatarSelf : - public LLVOAvatar -{ - LOG_CLASS(LLVOAvatarSelf); - -/******************************************************************************** - ** ** - ** INITIALIZATION - **/ - -public: - LLVOAvatarSelf(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - virtual ~LLVOAvatarSelf(); - virtual void markDead(); - virtual void initInstance(); // Called after construction to initialize the class. - void cleanup(); -protected: - /*virtual*/ bool loadAvatar(); - bool loadAvatarSelf(); - bool buildSkeletonSelf(const LLAvatarSkeletonInfo *info); - bool buildMenus(); - -/** Initialization - ** ** - *******************************************************************************/ - -/******************************************************************************** - ** ** - ** INHERITED - **/ - - //-------------------------------------------------------------------- - // LLViewerObject interface and related - //-------------------------------------------------------------------- -public: - boost::signals2::connection mRegionChangedSlot; - - void onSimulatorFeaturesReceived(const LLUUID& region_id); - /*virtual*/ void updateRegion(LLViewerRegion *regionp); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); - - //-------------------------------------------------------------------- - // LLCharacter interface and related - //-------------------------------------------------------------------- -public: - /*virtual*/ bool hasMotionFromSource(const LLUUID& source_id); - /*virtual*/ void stopMotionFromSource(const LLUUID& source_id); - /*virtual*/ void requestStopMotion(LLMotion* motion); - /*virtual*/ LLJoint* getJoint(const std::string &name); - - /*virtual*/ bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight); - /*virtual*/ bool setVisualParamWeight(const char* param_name, F32 weight); - /*virtual*/ bool setVisualParamWeight(S32 index, F32 weight); - /*virtual*/ void updateVisualParams(); - void writeWearablesToAvatar(); - /*virtual*/ void idleUpdateAppearanceAnimation(); - -private: - // helper function. Passed in param is assumed to be in avatar's parameter list. - bool setParamWeight(const LLViewerVisualParam *param, F32 weight); - -/******************************************************************************** - ** ** - ** STATE - **/ - -public: - /*virtual*/ bool isSelf() const { return true; } - virtual bool isBuddy() const { return false; } - /*virtual*/ bool isValid() const; - - //-------------------------------------------------------------------- - // Updates - //-------------------------------------------------------------------- -public: - /*virtual*/ bool updateCharacter(LLAgent &agent); - /*virtual*/ void idleUpdateTractorBeam(); - bool checkStuckAppearance(); - - //-------------------------------------------------------------------- - // Loading state - //-------------------------------------------------------------------- -public: - /*virtual*/ bool getIsCloud() const; - - //-------------------------------------------------------------------- - // Region state - //-------------------------------------------------------------------- - void resetRegionCrossingTimer() { mRegionCrossingTimer.reset(); } - -private: - U64 mLastRegionHandle; - LLFrameTimer mRegionCrossingTimer; - S32 mRegionCrossingCount; - -/** State - ** ** - *******************************************************************************/ - -/******************************************************************************** - ** ** - ** RENDERING - **/ - - //-------------------------------------------------------------------- - // Render beam - //-------------------------------------------------------------------- -protected: - bool needsRenderBeam(); -private: - LLPointer mBeam; - LLFrameTimer mBeamTimer; - - //-------------------------------------------------------------------- - // LLVOAvatar Constants - //-------------------------------------------------------------------- -public: - /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBoostLevel() const { return LLGLTexture::BOOST_AVATAR_SELF; } - /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLGLTexture::BOOST_AVATAR_BAKED_SELF; } - /*virtual*/ S32 getTexImageSize() const { return LLVOAvatar::getTexImageSize()*4; } - -/** Rendering - ** ** - *******************************************************************************/ - -/******************************************************************************** - ** ** - ** TEXTURES - **/ - - //-------------------------------------------------------------------- - // Loading status - //-------------------------------------------------------------------- -public: - S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; - bool areTexturesCurrent() const; - bool isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; - bool isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; - // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index - /*virtual*/ bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; - /*virtual*/ bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; - /*virtual*/ bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; - - - //-------------------------------------------------------------------- - // Local Textures - //-------------------------------------------------------------------- -public: - bool getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture** image_gl_pp, U32 index) const; - LLViewerFetchedTexture* getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; - const LLUUID& getLocalTextureID(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; - void setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index); - /*virtual*/ void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture* tex, bool baked_version_exits, U32 index); -protected: - /*virtual*/ void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, bool baked_version_exists, U32 index); - void localTextureLoaded(bool succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); - void getLocalTextureByteCount(S32* gl_byte_count) const; - /*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, bool rendered, bool covered_by_baked); - LLLocalTextureObject* getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 index) const; - -private: - static void onLocalTextureLoaded(bool succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); - - /*virtual*/ void setImage(const U8 te, LLViewerTexture *imagep, const U32 index); - /*virtual*/ LLViewerTexture* getImage(const U8 te, const U32 index) const; - - - //-------------------------------------------------------------------- - // Baked textures - //-------------------------------------------------------------------- -public: - LLAvatarAppearanceDefines::ETextureIndex getBakedTE(const LLViewerTexLayerSet* layerset ) const; - // SUNSHINE CLEANUP - dead? or update to just call request appearance update? - void forceBakeAllTextures(bool slam_for_debug = false); -protected: - /*virtual*/ void removeMissingBakedTextures(); - - //-------------------------------------------------------------------- - // Layers - //-------------------------------------------------------------------- -public: - void requestLayerSetUpdate(LLAvatarAppearanceDefines::ETextureIndex i); - LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; - LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::ETextureIndex index) const; - - - //-------------------------------------------------------------------- - // Composites - //-------------------------------------------------------------------- -public: - /* virtual */ void invalidateComposite(LLTexLayerSet* layerset); - /* virtual */ void invalidateAll(); - /* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self - /* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b); - /* virtual */ bool isCompositeUpdateEnabled(U32 index); - void setupComposites(); - void updateComposites(); - - const LLUUID& grabBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; - bool canGrabBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; - - - //-------------------------------------------------------------------- - // Scratch textures (used for compositing) - //-------------------------------------------------------------------- -public: - static void deleteScratchTextures(); -private: - static S32Bytes sScratchTexBytes; - static std::map< LLGLenum, LLGLuint*> sScratchTexNames; - -/** Textures - ** ** - *******************************************************************************/ - -/******************************************************************************** - ** ** - ** MESHES - **/ -protected: - /*virtual*/ void restoreMeshData(); - -/** Meshes - ** ** - *******************************************************************************/ - -/******************************************************************************** - ** ** - ** WEARABLES - **/ - -public: - void wearableUpdated(LLWearableType::EType type); -protected: - U32 getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const; - - //-------------------------------------------------------------------- - // Attachments - //-------------------------------------------------------------------- -public: - void updateAttachmentVisibility(U32 camera_mode); - bool isWearingAttachment(const LLUUID& inv_item_id) const; - LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); - bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const; - /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); - /*virtual*/ bool detachObject(LLViewerObject *viewer_object); - static bool detachAttachmentIntoInventory(const LLUUID& item_id); - - bool hasAttachmentsInTrash(); - - //-------------------------------------------------------------------- - // HUDs - //-------------------------------------------------------------------- -private: - LLViewerJoint* mScreenp; // special purpose joint for HUD attachments - -/** Attachments - ** ** - *******************************************************************************/ - -/******************************************************************************** - ** ** - ** APPEARANCE - **/ - -public: - static void onCustomizeStart(bool disable_camera_switch = false); - static void onCustomizeEnd(bool disable_camera_switch = false); - LLPointer mEndCustomizeCallback; - - //-------------------------------------------------------------------- - // Visibility - //-------------------------------------------------------------------- - - /* virtual */ bool shouldRenderRigged() const; - -public: - bool sendAppearanceMessage(LLMessageSystem *mesgsys) const; - - // -- care and feeding of hover height. - void setHoverIfRegionEnabled(); - void sendHoverHeight() const; - /*virtual*/ void setHoverOffset(const LLVector3& hover_offset, bool send_update=true); - -private: - mutable LLVector3 mLastHoverOffsetSent; - -/** Appearance - ** ** - *******************************************************************************/ - -/******************************************************************************** - ** ** - ** DIAGNOSTICS - **/ - - //-------------------------------------------------------------------- - // General - //-------------------------------------------------------------------- -public: - static void dumpTotalLocalTextureByteCount(); - void dumpLocalTextures() const; - static void dumpScratchTextureByteCount(); - void dumpWearableInfo(LLAPRFile& outfile); - - //-------------------------------------------------------------------- - // Avatar Rez Metrics - //-------------------------------------------------------------------- -public: - struct LLAvatarTexData - { - LLAvatarTexData(const LLUUID& id, LLAvatarAppearanceDefines::ETextureIndex index) : - mAvatarID(id), - mIndex(index) - {} - LLUUID mAvatarID; - LLAvatarAppearanceDefines::ETextureIndex mIndex; - }; - - LLTimer mTimeSinceLastRezMessage; - bool updateAvatarRezMetrics(bool force_send); - - std::vector mPendingTimerRecords; - void addMetricsTimerRecord(const LLSD& record); - - void debugWearablesLoaded() { mDebugTimeWearablesLoaded = mDebugSelfLoadTimer.getElapsedTimeF32(); } - void debugAvatarVisible() { mDebugTimeAvatarVisible = mDebugSelfLoadTimer.getElapsedTimeF32(); } - void outputRezDiagnostics() const; - void outputRezTiming(const std::string& msg) const; - void reportAvatarRezTime() const; - void debugBakedTextureUpload(LLAvatarAppearanceDefines::EBakedTextureIndex index, bool finished); - static void debugOnTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); - - bool isAllLocalTextureDataFinal() const; - - const LLViewerTexLayerSet* debugGetLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex index) const { return (LLViewerTexLayerSet*)(mBakedTextureDatas[index].mTexLayerSet); } - const std::string verboseDebugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer - void dumpAllTextures() const; - const std::string debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer - const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD - void sendViewerAppearanceChangeMetrics(); // send data associated with completing a change. -private: - LLFrameTimer mDebugSelfLoadTimer; - F32 mDebugTimeWearablesLoaded; - F32 mDebugTimeAvatarVisible; - F32 mDebugTextureLoadTimes[LLAvatarAppearanceDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level - F32 mDebugBakedTextureTimes[LLAvatarAppearanceDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture - void debugTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); - - void appearanceChangeMetricsCoro(std::string url); - bool mInitialMetric; - S32 mMetricSequence; -/** Diagnostics - ** ** - *******************************************************************************/ - -}; - -extern LLPointer gAgentAvatarp; - -bool isAgentAvatarValid(); - -void selfStartPhase(const std::string& phase_name); -void selfStopPhase(const std::string& phase_name, bool err_check = true); -void selfClearPhases(); - -#endif // LL_VO_AVATARSELF_H +/** + * @file llvoavatarself.h + * @brief Declaration of LLVOAvatar class which is a derivation fo + * LLViewerObject + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLVOAVATARSELF_H +#define LL_LLVOAVATARSELF_H + +#include "llviewertexture.h" +#include "llvoavatar.h" +#include +#include "lleventcoro.h" +#include "llcoros.h" + +struct LocalTextureData; +class LLInventoryCallback; + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// LLVOAvatarSelf +// +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLVOAvatarSelf : + public LLVOAvatar +{ + LOG_CLASS(LLVOAvatarSelf); + +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ + +public: + LLVOAvatarSelf(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); + virtual ~LLVOAvatarSelf(); + virtual void markDead(); + virtual void initInstance(); // Called after construction to initialize the class. + void cleanup(); +protected: + /*virtual*/ bool loadAvatar(); + bool loadAvatarSelf(); + bool buildSkeletonSelf(const LLAvatarSkeletonInfo *info); + bool buildMenus(); + +/** Initialization + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** INHERITED + **/ + + //-------------------------------------------------------------------- + // LLViewerObject interface and related + //-------------------------------------------------------------------- +public: + boost::signals2::connection mRegionChangedSlot; + + void onSimulatorFeaturesReceived(const LLUUID& region_id); + /*virtual*/ void updateRegion(LLViewerRegion *regionp); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); + + //-------------------------------------------------------------------- + // LLCharacter interface and related + //-------------------------------------------------------------------- +public: + /*virtual*/ bool hasMotionFromSource(const LLUUID& source_id); + /*virtual*/ void stopMotionFromSource(const LLUUID& source_id); + /*virtual*/ void requestStopMotion(LLMotion* motion); + /*virtual*/ LLJoint* getJoint(const std::string &name); + + /*virtual*/ bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight); + /*virtual*/ bool setVisualParamWeight(const char* param_name, F32 weight); + /*virtual*/ bool setVisualParamWeight(S32 index, F32 weight); + /*virtual*/ void updateVisualParams(); + void writeWearablesToAvatar(); + /*virtual*/ void idleUpdateAppearanceAnimation(); + +private: + // helper function. Passed in param is assumed to be in avatar's parameter list. + bool setParamWeight(const LLViewerVisualParam *param, F32 weight); + +/******************************************************************************** + ** ** + ** STATE + **/ + +public: + /*virtual*/ bool isSelf() const { return true; } + virtual bool isBuddy() const { return false; } + /*virtual*/ bool isValid() const; + + //-------------------------------------------------------------------- + // Updates + //-------------------------------------------------------------------- +public: + /*virtual*/ bool updateCharacter(LLAgent &agent); + /*virtual*/ void idleUpdateTractorBeam(); + bool checkStuckAppearance(); + + //-------------------------------------------------------------------- + // Loading state + //-------------------------------------------------------------------- +public: + /*virtual*/ bool getIsCloud() const; + + //-------------------------------------------------------------------- + // Region state + //-------------------------------------------------------------------- + void resetRegionCrossingTimer() { mRegionCrossingTimer.reset(); } + +private: + U64 mLastRegionHandle; + LLFrameTimer mRegionCrossingTimer; + S32 mRegionCrossingCount; + +/** State + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** RENDERING + **/ + + //-------------------------------------------------------------------- + // Render beam + //-------------------------------------------------------------------- +protected: + bool needsRenderBeam(); +private: + LLPointer mBeam; + LLFrameTimer mBeamTimer; + + //-------------------------------------------------------------------- + // LLVOAvatar Constants + //-------------------------------------------------------------------- +public: + /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBoostLevel() const { return LLGLTexture::BOOST_AVATAR_SELF; } + /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLGLTexture::BOOST_AVATAR_BAKED_SELF; } + /*virtual*/ S32 getTexImageSize() const { return LLVOAvatar::getTexImageSize()*4; } + +/** Rendering + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** TEXTURES + **/ + + //-------------------------------------------------------------------- + // Loading status + //-------------------------------------------------------------------- +public: + S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; + bool areTexturesCurrent() const; + bool isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; + bool isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; + // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index + /*virtual*/ bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; + /*virtual*/ bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; + /*virtual*/ bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; + + + //-------------------------------------------------------------------- + // Local Textures + //-------------------------------------------------------------------- +public: + bool getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture** image_gl_pp, U32 index) const; + LLViewerFetchedTexture* getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; + const LLUUID& getLocalTextureID(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; + void setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index); + /*virtual*/ void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture* tex, bool baked_version_exits, U32 index); +protected: + /*virtual*/ void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, bool baked_version_exists, U32 index); + void localTextureLoaded(bool succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); + void getLocalTextureByteCount(S32* gl_byte_count) const; + /*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, bool rendered, bool covered_by_baked); + LLLocalTextureObject* getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 index) const; + +private: + static void onLocalTextureLoaded(bool succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); + + /*virtual*/ void setImage(const U8 te, LLViewerTexture *imagep, const U32 index); + /*virtual*/ LLViewerTexture* getImage(const U8 te, const U32 index) const; + + + //-------------------------------------------------------------------- + // Baked textures + //-------------------------------------------------------------------- +public: + LLAvatarAppearanceDefines::ETextureIndex getBakedTE(const LLViewerTexLayerSet* layerset ) const; + // SUNSHINE CLEANUP - dead? or update to just call request appearance update? + void forceBakeAllTextures(bool slam_for_debug = false); +protected: + /*virtual*/ void removeMissingBakedTextures(); + + //-------------------------------------------------------------------- + // Layers + //-------------------------------------------------------------------- +public: + void requestLayerSetUpdate(LLAvatarAppearanceDefines::ETextureIndex i); + LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; + LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::ETextureIndex index) const; + + + //-------------------------------------------------------------------- + // Composites + //-------------------------------------------------------------------- +public: + /* virtual */ void invalidateComposite(LLTexLayerSet* layerset); + /* virtual */ void invalidateAll(); + /* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self + /* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b); + /* virtual */ bool isCompositeUpdateEnabled(U32 index); + void setupComposites(); + void updateComposites(); + + const LLUUID& grabBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; + bool canGrabBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; + + + //-------------------------------------------------------------------- + // Scratch textures (used for compositing) + //-------------------------------------------------------------------- +public: + static void deleteScratchTextures(); +private: + static S32Bytes sScratchTexBytes; + static std::map< LLGLenum, LLGLuint*> sScratchTexNames; + +/** Textures + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** MESHES + **/ +protected: + /*virtual*/ void restoreMeshData(); + +/** Meshes + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** WEARABLES + **/ + +public: + void wearableUpdated(LLWearableType::EType type); +protected: + U32 getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const; + + //-------------------------------------------------------------------- + // Attachments + //-------------------------------------------------------------------- +public: + void updateAttachmentVisibility(U32 camera_mode); + bool isWearingAttachment(const LLUUID& inv_item_id) const; + LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); + bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const; + /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); + /*virtual*/ bool detachObject(LLViewerObject *viewer_object); + static bool detachAttachmentIntoInventory(const LLUUID& item_id); + + bool hasAttachmentsInTrash(); + + //-------------------------------------------------------------------- + // HUDs + //-------------------------------------------------------------------- +private: + LLViewerJoint* mScreenp; // special purpose joint for HUD attachments + +/** Attachments + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** APPEARANCE + **/ + +public: + static void onCustomizeStart(bool disable_camera_switch = false); + static void onCustomizeEnd(bool disable_camera_switch = false); + LLPointer mEndCustomizeCallback; + + //-------------------------------------------------------------------- + // Visibility + //-------------------------------------------------------------------- + + /* virtual */ bool shouldRenderRigged() const; + +public: + bool sendAppearanceMessage(LLMessageSystem *mesgsys) const; + + // -- care and feeding of hover height. + void setHoverIfRegionEnabled(); + void sendHoverHeight() const; + /*virtual*/ void setHoverOffset(const LLVector3& hover_offset, bool send_update=true); + +private: + mutable LLVector3 mLastHoverOffsetSent; + +/** Appearance + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** DIAGNOSTICS + **/ + + //-------------------------------------------------------------------- + // General + //-------------------------------------------------------------------- +public: + static void dumpTotalLocalTextureByteCount(); + void dumpLocalTextures() const; + static void dumpScratchTextureByteCount(); + void dumpWearableInfo(LLAPRFile& outfile); + + //-------------------------------------------------------------------- + // Avatar Rez Metrics + //-------------------------------------------------------------------- +public: + struct LLAvatarTexData + { + LLAvatarTexData(const LLUUID& id, LLAvatarAppearanceDefines::ETextureIndex index) : + mAvatarID(id), + mIndex(index) + {} + LLUUID mAvatarID; + LLAvatarAppearanceDefines::ETextureIndex mIndex; + }; + + LLTimer mTimeSinceLastRezMessage; + bool updateAvatarRezMetrics(bool force_send); + + std::vector mPendingTimerRecords; + void addMetricsTimerRecord(const LLSD& record); + + void debugWearablesLoaded() { mDebugTimeWearablesLoaded = mDebugSelfLoadTimer.getElapsedTimeF32(); } + void debugAvatarVisible() { mDebugTimeAvatarVisible = mDebugSelfLoadTimer.getElapsedTimeF32(); } + void outputRezDiagnostics() const; + void outputRezTiming(const std::string& msg) const; + void reportAvatarRezTime() const; + void debugBakedTextureUpload(LLAvatarAppearanceDefines::EBakedTextureIndex index, bool finished); + static void debugOnTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); + + bool isAllLocalTextureDataFinal() const; + + const LLViewerTexLayerSet* debugGetLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex index) const { return (LLViewerTexLayerSet*)(mBakedTextureDatas[index].mTexLayerSet); } + const std::string verboseDebugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer + void dumpAllTextures() const; + const std::string debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer + const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD + void sendViewerAppearanceChangeMetrics(); // send data associated with completing a change. +private: + LLFrameTimer mDebugSelfLoadTimer; + F32 mDebugTimeWearablesLoaded; + F32 mDebugTimeAvatarVisible; + F32 mDebugTextureLoadTimes[LLAvatarAppearanceDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level + F32 mDebugBakedTextureTimes[LLAvatarAppearanceDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture + void debugTimingLocalTexLoaded(bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, bool final, void* userdata); + + void appearanceChangeMetricsCoro(std::string url); + bool mInitialMetric; + S32 mMetricSequence; +/** Diagnostics + ** ** + *******************************************************************************/ + +}; + +extern LLPointer gAgentAvatarp; + +bool isAgentAvatarValid(); + +void selfStartPhase(const std::string& phase_name); +void selfStopPhase(const std::string& phase_name, bool err_check = true); +void selfClearPhases(); + +#endif // LL_VO_AVATARSELF_H -- cgit v1.2.3