diff options
Diffstat (limited to 'linden/indra/llprimitive/llmaterialtable.h')
-rw-r--r-- | linden/indra/llprimitive/llmaterialtable.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/linden/indra/llprimitive/llmaterialtable.h b/linden/indra/llprimitive/llmaterialtable.h index 863fb25..8290195 100644 --- a/linden/indra/llprimitive/llmaterialtable.h +++ b/linden/indra/llprimitive/llmaterialtable.h | |||
@@ -67,7 +67,7 @@ class LLMaterialInfo | |||
67 | { | 67 | { |
68 | public: | 68 | public: |
69 | U8 mMCode; | 69 | U8 mMCode; |
70 | char mName[LLMATERIAL_INFO_NAME_LENGTH]; /* Flawfinder: ignore */ | 70 | std::string mName; |
71 | LLUUID mDefaultTextureID; | 71 | LLUUID mDefaultTextureID; |
72 | LLUUID mShatterSoundID; | 72 | LLUUID mShatterSoundID; |
73 | F32 mDensity; // kg/m^3 | 73 | F32 mDensity; // kg/m^3 |
@@ -79,24 +79,20 @@ public: | |||
79 | F32 mDamageModifier; // modifier on KE based damage | 79 | F32 mDamageModifier; // modifier on KE based damage |
80 | F32 mEPModifier; // modifier on mass based EP total | 80 | F32 mEPModifier; // modifier on mass based EP total |
81 | 81 | ||
82 | LLMaterialInfo(U8 mcode, char* name, const LLUUID &uuid) | 82 | LLMaterialInfo(U8 mcode, const std::string& name, const LLUUID &uuid) |
83 | { | 83 | { |
84 | init(mcode,name,uuid); | 84 | init(mcode,name,uuid); |
85 | }; | 85 | }; |
86 | 86 | ||
87 | void init(U8 mcode, char* name, const LLUUID &uuid) | 87 | void init(U8 mcode, const std::string& name, const LLUUID &uuid) |
88 | { | 88 | { |
89 | mName[0] = 0; | ||
90 | mDensity = 1000.f; // default to 1000.0 (water) | 89 | mDensity = 1000.f; // default to 1000.0 (water) |
91 | mHPModifier = 1.f; | 90 | mHPModifier = 1.f; |
92 | mDamageModifier = 1.f; | 91 | mDamageModifier = 1.f; |
93 | mEPModifier = 1.f; | 92 | mEPModifier = 1.f; |
94 | 93 | ||
95 | mMCode = mcode; | 94 | mMCode = mcode; |
96 | if (name) | 95 | mName = name; |
97 | { | ||
98 | LLString::copy(mName,name,LLMATERIAL_INFO_NAME_LENGTH); | ||
99 | } | ||
100 | mDefaultTextureID = uuid; | 96 | mDefaultTextureID = uuid; |
101 | }; | 97 | }; |
102 | 98 | ||
@@ -150,7 +146,7 @@ public: | |||
150 | 146 | ||
151 | void initBasicTable(); | 147 | void initBasicTable(); |
152 | 148 | ||
153 | BOOL add(U8 mcode, char* name, const LLUUID &uuid); | 149 | BOOL add(U8 mcode, const std::string& name, const LLUUID &uuid); |
154 | BOOL addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid); | 150 | BOOL addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid); |
155 | BOOL addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); | 151 | BOOL addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); |
156 | BOOL addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); | 152 | BOOL addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); |
@@ -160,10 +156,10 @@ public: | |||
160 | BOOL addRestitution(U8 mcode, const F32 &restitution); | 156 | BOOL addRestitution(U8 mcode, const F32 &restitution); |
161 | BOOL addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod); | 157 | BOOL addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod); |
162 | 158 | ||
163 | LLUUID getDefaultTextureID(char* name); // LLUUID::null if not found | 159 | LLUUID getDefaultTextureID(const std::string& name); // LLUUID::null if not found |
164 | LLUUID getDefaultTextureID(U8 mcode); // LLUUID::null if not found | 160 | LLUUID getDefaultTextureID(U8 mcode); // LLUUID::null if not found |
165 | U8 getMCode(const char* name); // 0 if not found | 161 | U8 getMCode(const std::string& name); // 0 if not found |
166 | char* getName(U8 mcode); | 162 | std::string getName(U8 mcode); |
167 | 163 | ||
168 | F32 getDensity(U8 mcode); // kg/m^3, 0 if not found | 164 | F32 getDensity(U8 mcode); // kg/m^3, 0 if not found |
169 | F32 getFriction(U8 mcode); // physics values | 165 | F32 getFriction(U8 mcode); // physics values |