Changeset 8673 for code/branches/presentation/src
- Timestamp:
- May 29, 2011, 11:59:17 PM (13 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 8 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/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.