aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llwearable.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llwearable.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llwearable.h')
-rw-r--r--linden/indra/newview/llwearable.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/linden/indra/newview/llwearable.h b/linden/indra/newview/llwearable.h
index 977d29b..c5f9d06 100644
--- a/linden/indra/newview/llwearable.h
+++ b/linden/indra/newview/llwearable.h
@@ -61,15 +61,13 @@ enum EWearableType // If you change this, update LLWearable::getTypeName(), get
61 61
62class LLWearable 62class LLWearable
63{ 63{
64 friend class LLWearableList;
64public: 65public:
65 LLWearable(const LLTransactionID& transactionID);
66 LLWearable(const LLAssetID& assetID);
67 ~LLWearable(); 66 ~LLWearable();
68 67
69 const LLAssetID& getID() { return mAssetID; } 68 const LLAssetID& getID() { return mAssetID; }
70 const LLTransactionID& getTransactionID() { return mTransactionID; } 69 const LLTransactionID& getTransactionID() { return mTransactionID; }
71 70
72 BOOL readData( const char *buffer );
73 BOOL isDirty(); 71 BOOL isDirty();
74 BOOL isOldVersion(); 72 BOOL isOldVersion();
75 73
@@ -84,11 +82,11 @@ public:
84 EWearableType getType() const { return mType; } 82 EWearableType getType() const { return mType; }
85 void setType( EWearableType type ) { mType = type; } 83 void setType( EWearableType type ) { mType = type; }
86 84
87 void setName( const LLString& name ) { mName = name; } 85 void setName( const std::string& name ) { mName = name; }
88 const LLString& getName() { return mName; } 86 const std::string& getName() { return mName; }
89 87
90 void setDescription( const LLString& desc ) { mDescription = desc; } 88 void setDescription( const std::string& desc ) { mDescription = desc; }
91 const LLString& getDescription() { return mDescription; } 89 const std::string& getDescription() { return mDescription; }
92 90
93 void setPermissions( const LLPermissions& p ) { mPermissions = p; } 91 void setPermissions( const LLPermissions& p ) { mPermissions = p; }
94 const LLPermissions& getPermissions() { return mPermissions; } 92 const LLPermissions& getPermissions() { return mPermissions; }
@@ -96,17 +94,17 @@ public:
96 void setSaleInfo( const LLSaleInfo& info ) { mSaleInfo = info; } 94 void setSaleInfo( const LLSaleInfo& info ) { mSaleInfo = info; }
97 const LLSaleInfo& getSaleInfo() { return mSaleInfo; } 95 const LLSaleInfo& getSaleInfo() { return mSaleInfo; }
98 96
99 const char* getTypeLabel() const { return LLWearable::sTypeLabel[ mType ]; } 97 const std::string& getTypeLabel() const { return LLWearable::sTypeLabel[ mType ]; }
100 const char* getTypeName() const { return LLWearable::sTypeName[ mType ]; } 98 const std::string& getTypeName() const { return LLWearable::sTypeName[ mType ]; }
101 99
102 void setParamsToDefaults(); 100 void setParamsToDefaults();
103 void setTexturesToDefaults(); 101 void setTexturesToDefaults();
104 102
105 LLAssetType::EType getAssetType() const { return LLWearable::typeToAssetType( mType ); } 103 LLAssetType::EType getAssetType() const { return LLWearable::typeToAssetType( mType ); }
106 104
107 static EWearableType typeNameToType( const LLString& type_name ); 105 static EWearableType typeNameToType( const std::string& type_name );
108 static const char* typeToTypeName( EWearableType type ) { return (type<WT_COUNT) ? LLWearable::sTypeName[type] : "invalid"; } 106 static const std::string& typeToTypeName( EWearableType type ) { return LLWearable::sTypeName[llmin(type,WT_COUNT)]; }
109 static const char* typeToTypeLabel( EWearableType type ) { return (type<WT_COUNT) ? LLWearable::sTypeLabel[type] : "invalid"; } 107 static const std::string& typeToTypeLabel( EWearableType type ) { return LLWearable::sTypeLabel[llmin(type,WT_COUNT)]; }
110 static LLAssetType::EType typeToAssetType( EWearableType wearable_type ); 108 static LLAssetType::EType typeToAssetType( EWearableType wearable_type );
111 109
112 void saveNewAsset(); 110 void saveNewAsset();
@@ -121,10 +119,14 @@ public:
121 friend std::ostream& operator<<(std::ostream &s, const LLWearable &w); 119 friend std::ostream& operator<<(std::ostream &s, const LLWearable &w);
122 120
123private: 121private:
122 // Private constructor used by LLWearableList
123 LLWearable(const LLTransactionID& transactionID);
124 LLWearable(const LLAssetID& assetID);
125
124 static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml. 126 static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml.
125 S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created. 127 S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created.
126 LLString mName; 128 std::string mName;
127 LLString mDescription; 129 std::string mDescription;
128 LLPermissions mPermissions; 130 LLPermissions mPermissions;
129 LLSaleInfo mSaleInfo; 131 LLSaleInfo mSaleInfo;
130 LLAssetID mAssetID; 132 LLAssetID mAssetID;
@@ -136,8 +138,8 @@ private:
136 typedef std::map<S32, LLUUID> te_map_t; 138 typedef std::map<S32, LLUUID> te_map_t;
137 te_map_t mTEMap; // maps TE to Image ID 139 te_map_t mTEMap; // maps TE to Image ID
138 140
139 static const char* sTypeName[ WT_COUNT ]; 141 static const std::string sTypeName[ WT_COUNT+1 ];
140 static const char* sTypeLabel[ WT_COUNT ]; 142 static const std::string sTypeLabel[ WT_COUNT+1 ];
141}; 143};
142 144
143#endif // LL_LLWEARABLE_H 145#endif // LL_LLWEARABLE_H