diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llprimitive/llmaterialtable.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llprimitive/llmaterialtable.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/linden/indra/llprimitive/llmaterialtable.cpp b/linden/indra/llprimitive/llmaterialtable.cpp index ee088d0..537c968 100644 --- a/linden/indra/llprimitive/llmaterialtable.cpp +++ b/linden/indra/llprimitive/llmaterialtable.cpp | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "linden_common.h" | 32 | #include "linden_common.h" |
33 | 33 | ||
34 | #include "llmaterialtable.h" | 34 | #include "llmaterialtable.h" |
35 | #include "llstl.h" | ||
35 | #include "material_codes.h" | 36 | #include "material_codes.h" |
36 | #include "sound_ids.h" | 37 | #include "sound_ids.h" |
37 | #include "imageids.h" | 38 | #include "imageids.h" |
@@ -70,7 +71,8 @@ LLMaterialTable::~LLMaterialTable() | |||
70 | mRollingSoundMatrix = NULL; | 71 | mRollingSoundMatrix = NULL; |
71 | } | 72 | } |
72 | 73 | ||
73 | mMaterialInfoList.deleteAllData(); | 74 | for_each(mMaterialInfoList.begin(), mMaterialInfoList.end(), DeletePointer()); |
75 | mMaterialInfoList.clear(); | ||
74 | } | 76 | } |
75 | 77 | ||
76 | void LLMaterialTable::initBasicTable() | 78 | void LLMaterialTable::initBasicTable() |
@@ -290,7 +292,7 @@ BOOL LLMaterialTable::add(U8 mcode, char* name, const LLUUID &uuid) | |||
290 | 292 | ||
291 | // Add at the end so the order in menus matches the order in this | 293 | // Add at the end so the order in menus matches the order in this |
292 | // file. JNC 11.30.01 | 294 | // file. JNC 11.30.01 |
293 | mMaterialInfoList.addDataAtEnd(infop); | 295 | mMaterialInfoList.push_back(infop); |
294 | 296 | ||
295 | return TRUE; | 297 | return TRUE; |
296 | } | 298 | } |
@@ -336,10 +338,10 @@ BOOL LLMaterialTable::addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid) | |||
336 | 338 | ||
337 | BOOL LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid) | 339 | BOOL LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid) |
338 | { | 340 | { |
339 | LLMaterialInfo *infop; | 341 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
340 | 342 | iter != mMaterialInfoList.end(); ++iter) | |
341 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | ||
342 | { | 343 | { |
344 | LLMaterialInfo *infop = *iter; | ||
343 | if (mcode == infop->mMCode) | 345 | if (mcode == infop->mMCode) |
344 | { | 346 | { |
345 | infop->mShatterSoundID = uuid; | 347 | infop->mShatterSoundID = uuid; |
@@ -352,10 +354,10 @@ BOOL LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid) | |||
352 | 354 | ||
353 | BOOL LLMaterialTable::addDensity(U8 mcode, const F32 &density) | 355 | BOOL LLMaterialTable::addDensity(U8 mcode, const F32 &density) |
354 | { | 356 | { |
355 | LLMaterialInfo *infop; | 357 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
356 | 358 | iter != mMaterialInfoList.end(); ++iter) | |
357 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | ||
358 | { | 359 | { |
360 | LLMaterialInfo *infop = *iter; | ||
359 | if (mcode == infop->mMCode) | 361 | if (mcode == infop->mMCode) |
360 | { | 362 | { |
361 | infop->mDensity = density; | 363 | infop->mDensity = density; |
@@ -368,10 +370,10 @@ BOOL LLMaterialTable::addDensity(U8 mcode, const F32 &density) | |||
368 | 370 | ||
369 | BOOL LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution) | 371 | BOOL LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution) |
370 | { | 372 | { |
371 | LLMaterialInfo *infop; | 373 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
372 | 374 | iter != mMaterialInfoList.end(); ++iter) | |
373 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | ||
374 | { | 375 | { |
376 | LLMaterialInfo *infop = *iter; | ||
375 | if (mcode == infop->mMCode) | 377 | if (mcode == infop->mMCode) |
376 | { | 378 | { |
377 | infop->mRestitution = restitution; | 379 | infop->mRestitution = restitution; |
@@ -384,10 +386,10 @@ BOOL LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution) | |||
384 | 386 | ||
385 | BOOL LLMaterialTable::addFriction(U8 mcode, const F32 &friction) | 387 | BOOL LLMaterialTable::addFriction(U8 mcode, const F32 &friction) |
386 | { | 388 | { |
387 | LLMaterialInfo *infop; | 389 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
388 | 390 | iter != mMaterialInfoList.end(); ++iter) | |
389 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | ||
390 | { | 391 | { |
392 | LLMaterialInfo *infop = *iter; | ||
391 | if (mcode == infop->mMCode) | 393 | if (mcode == infop->mMCode) |
392 | { | 394 | { |
393 | infop->mFriction = friction; | 395 | infop->mFriction = friction; |
@@ -400,10 +402,10 @@ BOOL LLMaterialTable::addFriction(U8 mcode, const F32 &friction) | |||
400 | 402 | ||
401 | BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod) | 403 | BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod) |
402 | { | 404 | { |
403 | LLMaterialInfo *infop; | 405 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
404 | 406 | iter != mMaterialInfoList.end(); ++iter) | |
405 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | ||
406 | { | 407 | { |
408 | LLMaterialInfo *infop = *iter; | ||
407 | if (mcode == infop->mMCode) | 409 | if (mcode == infop->mMCode) |
408 | { | 410 | { |
409 | infop->mHPModifier = hp_mod; | 411 | infop->mHPModifier = hp_mod; |
@@ -418,10 +420,10 @@ BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 | |||
418 | 420 | ||
419 | LLUUID LLMaterialTable::getDefaultTextureID(char* name) | 421 | LLUUID LLMaterialTable::getDefaultTextureID(char* name) |
420 | { | 422 | { |
421 | LLMaterialInfo *infop; | 423 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
422 | 424 | iter != mMaterialInfoList.end(); ++iter) | |
423 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | ||
424 | { | 425 | { |
426 | LLMaterialInfo *infop = *iter; | ||
425 | if (!strcmp(name, infop->mName)) | 427 | if (!strcmp(name, infop->mName)) |
426 | { | 428 | { |
427 | return infop->mDefaultTextureID; | 429 | return infop->mDefaultTextureID; |
@@ -434,12 +436,11 @@ LLUUID LLMaterialTable::getDefaultTextureID(char* name) | |||
434 | 436 | ||
435 | LLUUID LLMaterialTable::getDefaultTextureID(U8 mcode) | 437 | LLUUID LLMaterialTable::getDefaultTextureID(U8 mcode) |
436 | { | 438 | { |
437 | LLMaterialInfo *infop; | ||
438 | |||
439 | mcode &= LL_MCODE_MASK; | 439 | mcode &= LL_MCODE_MASK; |
440 | 440 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); | |
441 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 441 | iter != mMaterialInfoList.end(); ++iter) |
442 | { | 442 | { |
443 | LLMaterialInfo *infop = *iter; | ||
443 | if (mcode == infop->mMCode) | 444 | if (mcode == infop->mMCode) |
444 | { | 445 | { |
445 | return infop->mDefaultTextureID; | 446 | return infop->mDefaultTextureID; |
@@ -452,10 +453,10 @@ LLUUID LLMaterialTable::getDefaultTextureID(U8 mcode) | |||
452 | 453 | ||
453 | U8 LLMaterialTable::getMCode(const char* name) | 454 | U8 LLMaterialTable::getMCode(const char* name) |
454 | { | 455 | { |
455 | LLMaterialInfo *infop; | 456 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
456 | 457 | iter != mMaterialInfoList.end(); ++iter) | |
457 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | ||
458 | { | 458 | { |
459 | LLMaterialInfo *infop = *iter; | ||
459 | if (!strcmp(name, infop->mName)) | 460 | if (!strcmp(name, infop->mName)) |
460 | { | 461 | { |
461 | return infop->mMCode; | 462 | return infop->mMCode; |
@@ -468,12 +469,11 @@ U8 LLMaterialTable::getMCode(const char* name) | |||
468 | 469 | ||
469 | char* LLMaterialTable::getName(U8 mcode) | 470 | char* LLMaterialTable::getName(U8 mcode) |
470 | { | 471 | { |
471 | LLMaterialInfo *infop; | ||
472 | |||
473 | mcode &= LL_MCODE_MASK; | 472 | mcode &= LL_MCODE_MASK; |
474 | 473 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); | |
475 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 474 | iter != mMaterialInfoList.end(); ++iter) |
476 | { | 475 | { |
476 | LLMaterialInfo *infop = *iter; | ||
477 | if (mcode == infop->mMCode) | 477 | if (mcode == infop->mMCode) |
478 | { | 478 | { |
479 | return infop->mName; | 479 | return infop->mName; |
@@ -569,11 +569,11 @@ LLUUID LLMaterialTable::getGroundCollisionParticleUUID(U8 mcode) | |||
569 | 569 | ||
570 | F32 LLMaterialTable::getDensity(U8 mcode) | 570 | F32 LLMaterialTable::getDensity(U8 mcode) |
571 | { | 571 | { |
572 | LLMaterialInfo *infop; | ||
573 | |||
574 | mcode &= LL_MCODE_MASK; | 572 | mcode &= LL_MCODE_MASK; |
575 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 573 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
574 | iter != mMaterialInfoList.end(); ++iter) | ||
576 | { | 575 | { |
576 | LLMaterialInfo *infop = *iter; | ||
577 | if (mcode == infop->mMCode) | 577 | if (mcode == infop->mMCode) |
578 | { | 578 | { |
579 | return infop->mDensity; | 579 | return infop->mDensity; |
@@ -585,11 +585,11 @@ F32 LLMaterialTable::getDensity(U8 mcode) | |||
585 | 585 | ||
586 | F32 LLMaterialTable::getRestitution(U8 mcode) | 586 | F32 LLMaterialTable::getRestitution(U8 mcode) |
587 | { | 587 | { |
588 | LLMaterialInfo *infop; | ||
589 | |||
590 | mcode &= LL_MCODE_MASK; | 588 | mcode &= LL_MCODE_MASK; |
591 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 589 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
590 | iter != mMaterialInfoList.end(); ++iter) | ||
592 | { | 591 | { |
592 | LLMaterialInfo *infop = *iter; | ||
593 | if (mcode == infop->mMCode) | 593 | if (mcode == infop->mMCode) |
594 | { | 594 | { |
595 | return infop->mRestitution; | 595 | return infop->mRestitution; |
@@ -601,11 +601,11 @@ F32 LLMaterialTable::getRestitution(U8 mcode) | |||
601 | 601 | ||
602 | F32 LLMaterialTable::getFriction(U8 mcode) | 602 | F32 LLMaterialTable::getFriction(U8 mcode) |
603 | { | 603 | { |
604 | LLMaterialInfo *infop; | ||
605 | |||
606 | mcode &= LL_MCODE_MASK; | 604 | mcode &= LL_MCODE_MASK; |
607 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 605 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
606 | iter != mMaterialInfoList.end(); ++iter) | ||
608 | { | 607 | { |
608 | LLMaterialInfo *infop = *iter; | ||
609 | if (mcode == infop->mMCode) | 609 | if (mcode == infop->mMCode) |
610 | { | 610 | { |
611 | return infop->mFriction; | 611 | return infop->mFriction; |
@@ -617,11 +617,11 @@ F32 LLMaterialTable::getFriction(U8 mcode) | |||
617 | 617 | ||
618 | F32 LLMaterialTable::getHPMod(U8 mcode) | 618 | F32 LLMaterialTable::getHPMod(U8 mcode) |
619 | { | 619 | { |
620 | LLMaterialInfo *infop; | ||
621 | |||
622 | mcode &= LL_MCODE_MASK; | 620 | mcode &= LL_MCODE_MASK; |
623 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 621 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
622 | iter != mMaterialInfoList.end(); ++iter) | ||
624 | { | 623 | { |
624 | LLMaterialInfo *infop = *iter; | ||
625 | if (mcode == infop->mMCode) | 625 | if (mcode == infop->mMCode) |
626 | { | 626 | { |
627 | return infop->mHPModifier; | 627 | return infop->mHPModifier; |
@@ -633,11 +633,11 @@ F32 LLMaterialTable::getHPMod(U8 mcode) | |||
633 | 633 | ||
634 | F32 LLMaterialTable::getDamageMod(U8 mcode) | 634 | F32 LLMaterialTable::getDamageMod(U8 mcode) |
635 | { | 635 | { |
636 | LLMaterialInfo *infop; | ||
637 | |||
638 | mcode &= LL_MCODE_MASK; | 636 | mcode &= LL_MCODE_MASK; |
639 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 637 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
638 | iter != mMaterialInfoList.end(); ++iter) | ||
640 | { | 639 | { |
640 | LLMaterialInfo *infop = *iter; | ||
641 | if (mcode == infop->mMCode) | 641 | if (mcode == infop->mMCode) |
642 | { | 642 | { |
643 | return infop->mDamageModifier; | 643 | return infop->mDamageModifier; |
@@ -649,11 +649,11 @@ F32 LLMaterialTable::getDamageMod(U8 mcode) | |||
649 | 649 | ||
650 | F32 LLMaterialTable::getEPMod(U8 mcode) | 650 | F32 LLMaterialTable::getEPMod(U8 mcode) |
651 | { | 651 | { |
652 | LLMaterialInfo *infop; | ||
653 | |||
654 | mcode &= LL_MCODE_MASK; | 652 | mcode &= LL_MCODE_MASK; |
655 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 653 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
654 | iter != mMaterialInfoList.end(); ++iter) | ||
656 | { | 655 | { |
656 | LLMaterialInfo *infop = *iter; | ||
657 | if (mcode == infop->mMCode) | 657 | if (mcode == infop->mMCode) |
658 | { | 658 | { |
659 | return infop->mEPModifier; | 659 | return infop->mEPModifier; |
@@ -665,11 +665,11 @@ F32 LLMaterialTable::getEPMod(U8 mcode) | |||
665 | 665 | ||
666 | LLUUID LLMaterialTable::getShatterSoundUUID(U8 mcode) | 666 | LLUUID LLMaterialTable::getShatterSoundUUID(U8 mcode) |
667 | { | 667 | { |
668 | LLMaterialInfo *infop; | ||
669 | |||
670 | mcode &= LL_MCODE_MASK; | 668 | mcode &= LL_MCODE_MASK; |
671 | for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() ) | 669 | for (info_list_t::iterator iter = mMaterialInfoList.begin(); |
670 | iter != mMaterialInfoList.end(); ++iter) | ||
672 | { | 671 | { |
672 | LLMaterialInfo *infop = *iter; | ||
673 | if (mcode == infop->mMCode) | 673 | if (mcode == infop->mMCode) |
674 | { | 674 | { |
675 | return infop->mShatterSoundID; | 675 | return infop->mShatterSoundID; |