Changeset 7221 in orxonox.OLD for trunk/src/world_entities/projectiles
- Timestamp:
- Mar 15, 2006, 3:10:45 PM (19 years ago)
- Location:
- trunk/src/world_entities/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/projectiles/projectile.cc
r7193 r7221 61 61 62 62 63 void Projectile::loadExplosionSound(const char*explosionSound)63 void Projectile::loadExplosionSound(const std::string& explosionSound) 64 64 { 65 65 if (this->explosionBuffer != NULL) 66 66 ResourceManager::getInstance()->unload(this->explosionBuffer); 67 67 68 else if ( explosionSound != NULL)68 else if (!explosionSound.empty()) 69 69 { 70 70 this->explosionBuffer = (SoundBuffer*)ResourceManager::getInstance()->load(explosionSound, WAV); 71 71 if (this->explosionBuffer != NULL) 72 72 { 73 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound , this->getName());73 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->getName()); 74 74 } 75 75 else 76 76 { 77 PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound , this->getName());77 PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->getName()); 78 78 } 79 79 } … … 83 83 84 84 85 void Projectile::loadEngineSound(const char*engineSound)85 void Projectile::loadEngineSound(const std::string& engineSound) 86 86 { 87 87 if (this->engineBuffer != NULL) 88 88 ResourceManager::getInstance()->unload(this->engineBuffer); 89 89 90 else if ( engineSound != NULL)90 else if (!engineSound.empty()) 91 91 { 92 92 this->engineBuffer = (SoundBuffer*)ResourceManager::getInstance()->load(engineSound, WAV); 93 93 if (this->engineBuffer != NULL) 94 94 { 95 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound , this->getName());95 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->getName()); 96 96 } 97 97 else 98 98 { 99 PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound , this->getName());99 PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->getName()); 100 100 } 101 101 } -
trunk/src/world_entities/projectiles/projectile.h
r7193 r7221 26 26 void setLifeSpan(float lifeSpan); 27 27 28 void loadExplosionSound(const char*explosionSound);29 void loadEngineSound(const char*engineSound);28 void loadExplosionSound(const std::string& explosionSound); 29 void loadEngineSound(const std::string& engineSound); 30 30 void setMinEnergy(float energyMin); 31 31 /** @returns the minimal charched energy */
Note: See TracChangeset
for help on using the changeset viewer.