Changeset 8673
- Timestamp:
- May 29, 2011, 11:59:17 PM (13 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/hudimprovements (added) merged: 7920,7923,7932
- Property svn:mergeinfo changed
-
code/branches/presentation/data/overlays/HUDTemplates3.oxo
r7679 r8673 35 35 background = "Orxonox/HealthBarBackground" 36 36 size = "0.35, 0.0875" 37 position = "0.0 , 0.9 5"37 position = "0.0 , 0.9 " 38 38 pickpoint = "0, 1" 39 39 bartexture = "healthbar_bar.png" … … 56 56 background = "Orxonox/BarBackground" 57 57 size = "0.35, 0.05" 58 position = "0.0 , 1.0"58 position = "0.0 , 0.95 " 59 59 pickpoint = "0, 1" 60 60 correctaspect = false … … 64 64 <BarColour position = 1.0 colour = "0.7,0.2,0.2" /> 65 65 </HUDSpeedBar> 66 67 <HUDBoostBar 68 name = "BoostBar1" 69 backgroundtex = "bar1.png" 70 size = "0.35, 0.05" 71 position = "0.0 , 1.0 " 72 pickpoint = "0, 1" 73 correctaspect = false 74 > 75 <BarColour position = 0.0 colour = "0.7,0.2,0.2" /> 76 <BarColour position = 0.5 colour = "0.7,0.7,0.2" /> 77 <BarColour position = 1.0 colour = "0.2,0.7,0.2" /> 78 </HUDBoostBar> 66 79 67 80 <HUDNavigation -
code/branches/presentation/src/modules/overlays/OverlaysPrereqs.h
r8351 r8673 89 89 class HUDRadar; 90 90 class HUDSpeedBar; 91 class HUDBoostBar; 91 92 class HUDTimer; 92 93 class KillMessage; -
code/branches/presentation/src/modules/overlays/hud/CMakeLists.txt
r8637 r8673 4 4 HUDRadar.cc 5 5 HUDSpeedBar.cc 6 HUDBoostBar.cc 6 7 HUDHealthBar.cc 7 8 HUDTimer.cc -
code/branches/presentation/src/modules/overlays/hud/HUDBar.cc
r7801 r8673 26 26 * Fabian 'x3n' Landau 27 27 * Reto Grieder 28 * Benjamin Knecht 28 29 * 29 30 */ -
code/branches/presentation/src/modules/overlays/hud/HUDBar.h
r7401 r8673 26 26 * Fabian 'x3n' Landau 27 27 * Reto Grieder 28 * Benjamin Knecht 28 29 * 29 30 */ -
code/branches/presentation/src/orxonox/overlays/OrxonoxOverlay.cc
r8351 r8673 137 137 XMLPortParam(OrxonoxOverlay, "correctaspect", setAspectCorrection, getAspectCorrection, xmlelement, mode); 138 138 XMLPortParam(OrxonoxOverlay, "background", setBackgroundMaterial, getBackgroundMaterial, xmlelement, mode); 139 XMLPortParam(OrxonoxOverlay, "backgroundtex", setBackgroundTexture, getBackgroundTexture, xmlelement, mode); 139 140 } 140 141 … … 163 164 if (this->background_) 164 165 return this->background_->getMaterialName(); 166 else 167 return BLANKSTRING; 168 } 169 170 //! Sets the background texture name and creates a new material if necessary 171 void OrxonoxOverlay::setBackgroundTexture(const std::string& texture) 172 { 173 if (this->background_ && this->background_->getMaterial().isNull() && !texture.empty()) 174 { 175 // create new material 176 const std::string& materialname = "generated_material" + getUniqueNumberString(); 177 Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialname, "General")); 178 material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA); 179 Ogre::TextureUnitState* textureUnitState_ = material->getTechnique(0)->getPass(0)->createTextureUnitState(); 180 textureUnitState_->setTextureName(texture); 181 textureUnitState_->setNumMipmaps(0); 182 this->background_->setMaterialName(materialname); 183 } 184 } 185 186 //! Returns the the texture name of the background 187 const std::string& OrxonoxOverlay::getBackgroundTexture() const 188 { 189 if (this->background_) 190 { 191 Ogre::TextureUnitState* tempTx = this->background_->getMaterial()->getTechnique(0)->getPass(0)->getTextureUnitState(0); 192 return tempTx->getTextureName(); 193 } 165 194 else 166 195 return BLANKSTRING; … … 406 435 } 407 436 408 void OrxonoxOverlay::setBackgroundAlpha(float alpha) { 437 void OrxonoxOverlay::setBackgroundAlpha(float alpha) 438 { 409 439 Ogre::MaterialPtr ptr = this->background_->getMaterial(); 410 440 Ogre::TextureUnitState* tempTx = ptr->getTechnique(0)->getPass(0)->getTextureUnitState(0); 411 441 tempTx->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, alpha); 412 442 } 443 444 void OrxonoxOverlay::setBackgroundColour(ColourValue colour) 445 { 446 Ogre::MaterialPtr ptr = this->background_->getMaterial(); 447 Ogre::TextureUnitState* tempTx = ptr->getTechnique(0)->getPass(0)->getTextureUnitState(0); 448 tempTx->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour); 449 } 413 450 } -
code/branches/presentation/src/orxonox/overlays/OrxonoxOverlay.h
r8309 r8673 160 160 const std::string& getBackgroundMaterial() const; 161 161 162 void setBackgroundTexture(const std::string& texture); 163 const std::string& getBackgroundTexture() const; 164 162 165 void setBackgroundAlpha(float alpha); 166 167 void setBackgroundColour(ColourValue colour); 163 168 164 169 virtual void changedVisibility(); -
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h
r8648 r8673 88 88 { return this->bBoost_; } 89 89 90 inline float getBoostPower() const 91 { return this->boostPower_; } 92 inline float getInitialBoostPower() const 93 { return this->initialBoostPower_; } 94 95 inline bool isBoostCoolingDown() const 96 { return bBoostCooldown_; } 97 90 98 protected: 91 99 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const;
Note: See TracChangeset
for help on using the changeset viewer.