From c355fb98d3f4040196b7b8586dc9328fccb906d2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 06:12:50 +0000 Subject: Extracted texture baking system into llappearance library. --- indra/newview/llviewerwearable.h | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 indra/newview/llviewerwearable.h (limited to 'indra/newview/llviewerwearable.h') diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h new file mode 100644 index 0000000000..857900f583 --- /dev/null +++ b/indra/newview/llviewerwearable.h @@ -0,0 +1,116 @@ +/** + * @file llviewerwearable.h + * @brief LLViewerWearable class header file + * + * $LicenseInfo:firstyear=2012&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_VIEWER_WEARABLE_H +#define LL_VIEWER_WEARABLE_H + +#include "llwearable.h" +#include "llvoavatardefines.h" + +class LLViewerWearable : public LLWearable +{ + friend class LLWearableList; + + //-------------------------------------------------------------------- + // Constructors and destructors + //-------------------------------------------------------------------- +private: + // Private constructors used by LLViewerWearableList + LLViewerWearable(const LLTransactionID& transactionID); + LLViewerWearable(const LLAssetID& assetID); +public: + virtual ~LLViewerWearable(); + + //-------------------------------------------------------------------- + // Accessors + //-------------------------------------------------------------------- +public: + const LLUUID& getItemID() const { return mItemID; } + const LLAssetID& getAssetID() const { return mAssetID; } + const LLTransactionID& getTransactionID() const { return mTransactionID; } + void setItemID(const LLUUID& item_id); + +public: + /*virtual*/ BOOL exportFile(LLFILE* file) const; + /*virtual*/ EImportResult importFile(LLFILE* file); + + BOOL isDirty() const; + BOOL isOldVersion() const; + + /*virtual*/ void writeToAvatar(); + void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); } + static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake ); + + void setParamsToDefaults(); + void setTexturesToDefaults(); + + static const LLUUID getDefaultTextureImageID(LLVOAvatarDefines::ETextureIndex index); + + + void saveNewAsset() const; + static void onSaveNewAssetComplete( const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status ); + + void copyDataFrom(const LLViewerWearable* src); + + friend std::ostream& operator<<(std::ostream &s, const LLViewerWearable &w); + + /*virtual*/ LLLocalTextureObject* getLocalTextureObject(S32 index); + const LLLocalTextureObject* getLocalTextureObject(S32 index) const; + std::vector getLocalTextureListSeq(); + void setLocalTextureObject(S32 index, LLLocalTextureObject <o); + + void revertValues(); + void saveValues(); + void pullCrossWearableValues(); + + BOOL isOnTop() const; + + // Something happened that requires the wearable's label to be updated (e.g. worn/unworn). + void setLabelUpdated() const; + + // the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem, + // not the wearable asset itself. + void refreshName(); + +protected: + void createLayers(S32 te); + /*virtual*/void createVisualParams(); + void setVisualParams(); + + typedef std::map te_map_t; + void syncImages(te_map_t &src, te_map_t &dst); + void destroyTextures(); + LLTransactionID mTransactionID; + LLAssetID mAssetID; + LLUUID mItemID; // ID of the inventory item in the agent's inventory + + te_map_t mTEMap; // maps TE to LocalTextureObject + te_map_t mSavedTEMap; // last saved version of TEMap +}; + + +#endif // LL_VIEWER_WEARABLE_H + -- cgit v1.2.3 From 0c7623f628cbba999860379a2f5c302d94c1d287 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 08:37:58 +0000 Subject: Cleanup of llappearance refactor file definition order for easier diff'ing --- indra/newview/llviewerwearable.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerwearable.h') diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index 857900f583..a921f82e7d 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -54,8 +54,6 @@ public: void setItemID(const LLUUID& item_id); public: - /*virtual*/ BOOL exportFile(LLFILE* file) const; - /*virtual*/ EImportResult importFile(LLFILE* file); BOOL isDirty() const; BOOL isOldVersion() const; @@ -64,6 +62,9 @@ public: void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); } static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake ); + /*virtual*/ BOOL exportFile(LLFILE* file) const; + /*virtual*/ EImportResult importFile(LLFILE* file); + void setParamsToDefaults(); void setTexturesToDefaults(); @@ -81,6 +82,7 @@ public: const LLLocalTextureObject* getLocalTextureObject(S32 index) const; std::vector getLocalTextureListSeq(); void setLocalTextureObject(S32 index, LLLocalTextureObject <o); + void setVisualParams(); void revertValues(); void saveValues(); @@ -96,19 +98,19 @@ public: void refreshName(); protected: + typedef std::map te_map_t; + void createLayers(S32 te); /*virtual*/void createVisualParams(); - void setVisualParams(); - typedef std::map te_map_t; void syncImages(te_map_t &src, te_map_t &dst); void destroyTextures(); - LLTransactionID mTransactionID; LLAssetID mAssetID; - LLUUID mItemID; // ID of the inventory item in the agent's inventory + LLTransactionID mTransactionID; te_map_t mTEMap; // maps TE to LocalTextureObject te_map_t mSavedTEMap; // last saved version of TEMap + LLUUID mItemID; // ID of the inventory item in the agent's inventory }; -- cgit v1.2.3 From 21c364c4d455cc05ec176032e8c090be0cc4ed50 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 09:10:24 +0000 Subject: Renamed LLVOAvatarDefines to LLAvatarAppearanceDefines --- indra/newview/llviewerwearable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerwearable.h') diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index a921f82e7d..ccc26000f2 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -28,7 +28,7 @@ #define LL_VIEWER_WEARABLE_H #include "llwearable.h" -#include "llvoavatardefines.h" +#include "llavatarappearancedefines.h" class LLViewerWearable : public LLWearable { @@ -68,7 +68,7 @@ public: void setParamsToDefaults(); void setTexturesToDefaults(); - static const LLUUID getDefaultTextureImageID(LLVOAvatarDefines::ETextureIndex index); + static const LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index); void saveNewAsset() const; -- cgit v1.2.3 From 85d0bcc0630bfbf8b50be3a47a113c4f8d6ec9df Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 6 Sep 2012 02:53:55 +0000 Subject: Extracted mWearableDatas from LLAgentWearables into llappearance/LLWearableData. Moved LLDriverParam into llappearance --- indra/newview/llviewerwearable.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewerwearable.h') diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index ccc26000f2..b3c1e3c3ba 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -86,17 +86,17 @@ public: void revertValues(); void saveValues(); - void pullCrossWearableValues(); - - BOOL isOnTop() const; // Something happened that requires the wearable's label to be updated (e.g. worn/unworn). - void setLabelUpdated() const; + /*virtual*/void setUpdated() const; // the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem, // not the wearable asset itself. void refreshName(); + // Update the baked texture hash. + /*virtual*/void addToBakedTextureHash(LLMD5& hash) const; + protected: typedef std::map te_map_t; -- cgit v1.2.3 From f1d6052e36ed6d817faedf9b32cb9d889395cd88 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 11 Sep 2012 11:59:45 -0400 Subject: SH-3264 Moved over a few more items to llappearance moved over: isWearingWearableType wearable::writeToAvatar wearable::mTEMap (stores LocalTextureObject*) more from wearable::import/export wearable::createVisualParams, etc --- indra/newview/llviewerwearable.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewerwearable.h') diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index b3c1e3c3ba..d8412b1c65 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -30,6 +30,8 @@ #include "llwearable.h" #include "llavatarappearancedefines.h" +class LLVOAvatar; + class LLViewerWearable : public LLWearable { friend class LLWearableList; @@ -58,12 +60,11 @@ public: BOOL isDirty() const; BOOL isOldVersion() const; - /*virtual*/ void writeToAvatar(); + /*virtual*/ void writeToAvatar(LLAvatarAppearance *avatarp); void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); } static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake ); - /*virtual*/ BOOL exportFile(LLFILE* file) const; - /*virtual*/ EImportResult importFile(LLFILE* file); + /*virtual*/ EImportResult importFile(LLFILE* file, LLAvatarAppearance* avatarp); void setParamsToDefaults(); void setTexturesToDefaults(); @@ -98,18 +99,11 @@ public: /*virtual*/void addToBakedTextureHash(LLMD5& hash) const; protected: - typedef std::map te_map_t; - - void createLayers(S32 te); - /*virtual*/void createVisualParams(); - void syncImages(te_map_t &src, te_map_t &dst); void destroyTextures(); LLAssetID mAssetID; LLTransactionID mTransactionID; - te_map_t mTEMap; // maps TE to LocalTextureObject - te_map_t mSavedTEMap; // last saved version of TEMap LLUUID mItemID; // ID of the inventory item in the agent's inventory }; -- cgit v1.2.3 From 7153d1db11c00245a379fa9601f092020152ea73 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 20 Sep 2012 04:29:17 +0000 Subject: Partial rewrite of llifstream and llofstream (Windows implementation pending). Moved more functionality from llviewerwearable to llwearable --- indra/newview/llviewerwearable.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewerwearable.h') diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index d8412b1c65..65566f23a5 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -64,12 +64,12 @@ public: void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); } static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake ); - /*virtual*/ EImportResult importFile(LLFILE* file, LLAvatarAppearance* avatarp); + /*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); void setParamsToDefaults(); void setTexturesToDefaults(); - static const LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index); + /*virtual*/ LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const; void saveNewAsset() const; @@ -79,14 +79,8 @@ public: friend std::ostream& operator<<(std::ostream &s, const LLViewerWearable &w); - /*virtual*/ LLLocalTextureObject* getLocalTextureObject(S32 index); - const LLLocalTextureObject* getLocalTextureObject(S32 index) const; - std::vector getLocalTextureListSeq(); - void setLocalTextureObject(S32 index, LLLocalTextureObject <o); - void setVisualParams(); - - void revertValues(); - void saveValues(); + /*virtual*/ void revertValues(); + /*virtual*/ void saveValues(); // Something happened that requires the wearable's label to be updated (e.g. worn/unworn). /*virtual*/void setUpdated() const; @@ -99,8 +93,6 @@ public: /*virtual*/void addToBakedTextureHash(LLMD5& hash) const; protected: - void syncImages(te_map_t &src, te_map_t &dst); - void destroyTextures(); LLAssetID mAssetID; LLTransactionID mTransactionID; -- cgit v1.2.3