From f9a5cdba507096d16d834fe58c850b9f55ad9462 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 28 Sep 2012 01:06:17 +0000 Subject: Started stubbing out llsd support for tex layer information. --- indra/llappearance/lltexlayer.cpp | 31 +++++++++++++++++++++++++++++++ indra/llappearance/lltexlayer.h | 7 ++++++- indra/llappearance/llwearable.h | 1 + indra/llappearance/llwearabledata.h | 2 +- 4 files changed, 39 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index e90efac36b..79d870c61d 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -469,6 +469,31 @@ const std::string LLTexLayerSet::getBodyRegionName() const } +// virtual +void LLTexLayerSet::asLLSD(LLSD& sd) const +{ + sd["visible"] = LLSD::Boolean(isVisible()); + LLSD layer_list_sd; + layer_list_t::const_iterator layer_iter = mLayerList.begin(); + layer_list_t::const_iterator layer_end = mLayerList.end(); + for(; layer_iter != layer_end; ++layer_iter); + { + LLSD layer_sd; + //LLTexLayerInterface* layer = (*layer_iter); + //if (layer) + //{ + // layer->asLLSD(layer_sd); + //} + layer_list_sd.append(layer_sd); + } + LLSD mask_list_sd; + LLSD info_sd; + sd["layers"] = layer_list_sd; + sd["masks"] = mask_list_sd; + sd["info"] = info_sd; +} + + void LLTexLayerSet::destroyComposite() { if( mComposite ) @@ -966,6 +991,12 @@ LLTexLayer::~LLTexLayer() } +void LLTexLayer::asLLSD(LLSD& sd) const +{ + // *TODO: Finish + sd["id"] = getUUID(); +} + //----------------------------------------------------------------------------- // setInfo //----------------------------------------------------------------------------- diff --git a/indra/llappearance/lltexlayer.h b/indra/llappearance/lltexlayer.h index 692cfa1a38..a288d7fc50 100644 --- a/indra/llappearance/lltexlayer.h +++ b/indra/llappearance/lltexlayer.h @@ -89,6 +89,8 @@ public: ERenderPass getRenderPass() const; BOOL isVisibilityMask() const; + virtual void asLLSD(LLSD& sd) const {} + protected: const std::string& getGlobalColor() const; LLViewerVisualParam* getVisualParamPtr(S32 index) const; @@ -163,10 +165,11 @@ public: void setLTO(LLLocalTextureObject *lto) { mLocalTextureObject = lto; } LLLocalTextureObject* getLTO() { return mLocalTextureObject; } + /*virtual*/ void asLLSD(LLSD& sd) const; + static void calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color); protected: LLUUID getUUID() const; -private: typedef std::map alpha_cache_t; alpha_cache_t mAlphaCache; LLLocalTextureObject* mLocalTextureObject; @@ -214,6 +217,8 @@ public: static BOOL sHasCaches; + virtual void asLLSD(LLSD& sd) const; + protected: typedef std::vector layer_list_t; layer_list_t mLayerList; diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index bc73ed4d8c..4a59811795 100644 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -68,6 +68,7 @@ public: LLAssetType::EType getAssetType() const; S32 getDefinitionVersion() const { return mDefinitionVersion; } void setDefinitionVersion( S32 new_version ) { mDefinitionVersion = new_version; } + static S32 getCurrentDefinitionVersion() { return LLWearable::sCurrentDefinitionVersion; } public: typedef std::vector visual_param_vec_t; diff --git a/indra/llappearance/llwearabledata.h b/indra/llappearance/llwearabledata.h index 379384a989..3e92f2ead8 100644 --- a/indra/llappearance/llwearabledata.h +++ b/indra/llappearance/llwearabledata.h @@ -95,7 +95,7 @@ protected: //-------------------------------------------------------------------- // Member variables //-------------------------------------------------------------------- -private: +protected: LLAvatarAppearance* mAvatarAppearance; typedef std::vector wearableentry_vec_t; // all wearables of a certain type (EG all shirts) typedef std::map wearableentry_map_t; // wearable "categories" arranged by wearable type -- cgit v1.2.3