aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llprimitive/llmaterialtable.cpp
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/llprimitive/llmaterialtable.cpp
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/llprimitive/llmaterialtable.cpp')
-rw-r--r--linden/indra/llprimitive/llmaterialtable.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/linden/indra/llprimitive/llmaterialtable.cpp b/linden/indra/llprimitive/llmaterialtable.cpp
index 5e45e44..4fb6904 100644
--- a/linden/indra/llprimitive/llmaterialtable.cpp
+++ b/linden/indra/llprimitive/llmaterialtable.cpp
@@ -125,14 +125,15 @@ LLMaterialTable::~LLMaterialTable()
125 125
126void LLMaterialTable::initBasicTable() 126void LLMaterialTable::initBasicTable()
127{ 127{
128 add(LL_MCODE_STONE,"Stone", LL_DEFAULT_STONE_UUID); 128 // *TODO: Translate
129 add(LL_MCODE_METAL,"Metal", LL_DEFAULT_METAL_UUID); 129 add(LL_MCODE_STONE,std::string("Stone"), LL_DEFAULT_STONE_UUID);
130 add(LL_MCODE_GLASS,"Glass", LL_DEFAULT_GLASS_UUID); 130 add(LL_MCODE_METAL,std::string("Metal"), LL_DEFAULT_METAL_UUID);
131 add(LL_MCODE_WOOD,"Wood", LL_DEFAULT_WOOD_UUID); 131 add(LL_MCODE_GLASS,std::string("Glass"), LL_DEFAULT_GLASS_UUID);
132 add(LL_MCODE_FLESH,"Flesh", LL_DEFAULT_FLESH_UUID); 132 add(LL_MCODE_WOOD,std::string("Wood"), LL_DEFAULT_WOOD_UUID);
133 add(LL_MCODE_PLASTIC,"Plastic", LL_DEFAULT_PLASTIC_UUID); 133 add(LL_MCODE_FLESH,std::string("Flesh"), LL_DEFAULT_FLESH_UUID);
134 add(LL_MCODE_RUBBER,"Rubber", LL_DEFAULT_RUBBER_UUID); 134 add(LL_MCODE_PLASTIC,std::string("Plastic"), LL_DEFAULT_PLASTIC_UUID);
135 add(LL_MCODE_LIGHT,"Light", LL_DEFAULT_LIGHT_UUID); 135 add(LL_MCODE_RUBBER,std::string("Rubber"), LL_DEFAULT_RUBBER_UUID);
136 add(LL_MCODE_LIGHT,std::string("Light"), LL_DEFAULT_LIGHT_UUID);
136 137
137 // specify densities for these materials. . . 138 // specify densities for these materials. . .
138 // these were taken from http://www.mcelwee.net/html/densities_of_various_materials.html 139 // these were taken from http://www.mcelwee.net/html/densities_of_various_materials.html
@@ -331,7 +332,7 @@ void LLMaterialTable::initBasicTable()
331 } 332 }
332} 333}
333 334
334BOOL LLMaterialTable::add(U8 mcode, char* name, const LLUUID &uuid) 335BOOL LLMaterialTable::add(U8 mcode, const std::string& name, const LLUUID &uuid)
335{ 336{
336 LLMaterialInfo *infop; 337 LLMaterialInfo *infop;
337 338
@@ -466,13 +467,13 @@ BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32
466 return FALSE; 467 return FALSE;
467} 468}
468 469
469LLUUID LLMaterialTable::getDefaultTextureID(char* name) 470LLUUID LLMaterialTable::getDefaultTextureID(const std::string& name)
470{ 471{
471 for (info_list_t::iterator iter = mMaterialInfoList.begin(); 472 for (info_list_t::iterator iter = mMaterialInfoList.begin();
472 iter != mMaterialInfoList.end(); ++iter) 473 iter != mMaterialInfoList.end(); ++iter)
473 { 474 {
474 LLMaterialInfo *infop = *iter; 475 LLMaterialInfo *infop = *iter;
475 if (!strcmp(name, infop->mName)) 476 if (name == infop->mName)
476 { 477 {
477 return infop->mDefaultTextureID; 478 return infop->mDefaultTextureID;
478 } 479 }
@@ -499,13 +500,13 @@ LLUUID LLMaterialTable::getDefaultTextureID(U8 mcode)
499} 500}
500 501
501 502
502U8 LLMaterialTable::getMCode(const char* name) 503U8 LLMaterialTable::getMCode(const std::string& name)
503{ 504{
504 for (info_list_t::iterator iter = mMaterialInfoList.begin(); 505 for (info_list_t::iterator iter = mMaterialInfoList.begin();
505 iter != mMaterialInfoList.end(); ++iter) 506 iter != mMaterialInfoList.end(); ++iter)
506 { 507 {
507 LLMaterialInfo *infop = *iter; 508 LLMaterialInfo *infop = *iter;
508 if (!strcmp(name, infop->mName)) 509 if (name == infop->mName)
509 { 510 {
510 return infop->mMCode; 511 return infop->mMCode;
511 } 512 }
@@ -515,7 +516,7 @@ U8 LLMaterialTable::getMCode(const char* name)
515} 516}
516 517
517 518
518char* LLMaterialTable::getName(U8 mcode) 519std::string LLMaterialTable::getName(U8 mcode)
519{ 520{
520 mcode &= LL_MCODE_MASK; 521 mcode &= LL_MCODE_MASK;
521 for (info_list_t::iterator iter = mMaterialInfoList.begin(); 522 for (info_list_t::iterator iter = mMaterialInfoList.begin();