Changeset 6412 for code/branches/pickup2/src/modules/overlays/hud/HUDBar.cc
- Timestamp:
- Dec 25, 2009, 1:18:03 PM (15 years ago)
- Location:
- code/branches/pickup2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup2
- Property svn:mergeinfo changed
-
code/branches/pickup2/src/modules/overlays/hud/HUDBar.cc
r5929 r6412 67 67 68 68 HUDBar::HUDBar(BaseObject* creator) 69 : OrxonoxOverlay(creator) 69 : OrxonoxOverlay(creator), right2Left_(false), autoColour_(false) 70 70 { 71 71 RegisterObject(HUDBar); 72 72 73 73 // create new material 74 std::stringmaterialname = "barmaterial" + multi_cast<std::string>(materialcount_s++);74 const std::string& materialname = "barmaterial" + multi_cast<std::string>(materialcount_s++); 75 75 Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialname, "General")); 76 76 material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA); … … 85 85 86 86 this->value_ = 1.0f; // initielize with 1.0f to trigger a change when calling setValue(0.0f) on the line below 87 this->setAutoColour(true); 87 88 this->setValue(0.0f); // <-- 88 89 this->setRightToLeft(false); 89 this->setAutoColour(true);90 90 this->currentColour_ = ColourValue::White; 91 91 … … 122 122 { 123 123 ColourValue colour1(0, 0, 0, 1); 124 ColourValue colour2 = (*this->colours_.rbegin()).second;124 ColourValue colour2 = this->colours_.rbegin()->second; 125 125 float value1(0); 126 float value2 = (*this->colours_.rbegin()).first;126 float value2 = this->colours_.rbegin()->first; 127 127 for (std::map<float, ColourValue>::reverse_iterator it = this->colours_.rbegin(); it != this->colours_.rend(); ++it) 128 128 { 129 129 colour1 = colour2; 130 130 value1 = value2; 131 colour2 = (*it).second;132 value2 = (*it).first;131 colour2 = it->second; 132 value2 = it->first; 133 133 134 134 if (value2 < this->value_)
Note: See TracChangeset
for help on using the changeset viewer.