- Timestamp:
- May 9, 2019, 5:15:43 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
r12364 r12366 65 65 this->speed_ = 0; 66 66 this->accelerationFactor_ = 1.0f; 67 this->bDeleteBats_ = false;67 68 68 this->relMercyOffset_ = 0.05f; 69 69 this->orxoblox_ = this->getOrxoBlox(); … … 77 77 this->defScoreSound_ = new WorldSound(this->getContext()); 78 78 this->defScoreSound_->setVolume(1.0f); 79 this->defBatSound_ = new WorldSound(this->getContext()); 80 this->defBatSound_->setVolume(0.4f); 79 81 80 this->defBoundarySound_ = new WorldSound(this->getContext()); 82 81 this->defBoundarySound_->setVolume(0.5f); … … 85 84 { 86 85 this->defScoreSound_ = nullptr; 87 this->defBatSound_ = nullptr;86 88 87 this->defBoundarySound_ = nullptr; 89 88 } … … 96 95 OrxoBloxBall::~OrxoBloxBall() 97 96 { 98 if (this->isInitialized()) 99 { 100 if (this->bDeleteBats_) 101 102 delete[] this->batID_; 103 } 97 104 98 } 105 99 … … 109 103 SUPER(OrxoBloxBall, XMLPort, xmlelement, mode); 110 104 XMLPortParam(OrxoBloxBall, "defScoreSound", setDefScoreSound, getDefScoreSound, xmlelement, mode); 111 XMLPortParam(OrxoBloxBall, "defBatSound", setDefBatSound, getDefBatSound, xmlelement, mode);105 112 106 XMLPortParam(OrxoBloxBall, "defBoundarySound", setDefBoundarySound, getDefBoundarySound, xmlelement, mode); 113 107 } … … 121 115 registerVariable( this->fieldWidth_ ); 122 116 registerVariable( this->fieldHeight_ ); 123 registerVariable( this->batlength_ );117 124 118 registerVariable( this->speed_ ); 125 119 registerVariable( this->relMercyOffset_ ); … … 275 269 } 276 270 277 void OrxoBloxBall::setDefBatSound(const std::string &OrxoBloxSound) 278 { 279 if( defBatSound_ ) 280 defBatSound_->setSource(OrxoBloxSound); 281 else 282 assert(0); // This should never happen, because soundpointer is only available on master 283 } 284 285 const std::string& OrxoBloxBall::getDefBatSound() 286 { 287 if( defBatSound_ ) 288 return defBatSound_->getSource(); 289 else 290 assert(0); 291 return BLANKSTRING; 292 } 293 271 272 294 273 void OrxoBloxBall::setDefBoundarySound(const std::string &OrxoBloxSound) 295 274 {
Note: See TracChangeset
for help on using the changeset viewer.