Changeset 7207 in orxonox.OLD for branches/std/src/world_entities/weapons
- Timestamp:
- Mar 9, 2006, 11:35:50 PM (19 years ago)
- Location:
- branches/std/src/world_entities/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/world_entities/weapons/weapon.cc
r7193 r7207 232 232 * @param soundFile the soundFile's relative position to the data-directory (will be looked for by the ResourceManager) 233 233 */ 234 void Weapon::setActionSound(WeaponAction action, const char*soundFile)234 void Weapon::setActionSound(WeaponAction action, const std::string& soundFile) 235 235 { 236 236 if (action >= WA_ACTION_COUNT) … … 239 239 ResourceManager::getInstance()->unload(this->soundBuffers[action]); 240 240 241 else if ( soundFile != NULL)241 else if (!soundFile.empty()) 242 242 { 243 243 this->soundBuffers[action] = (SoundBuffer*)ResourceManager::getInstance()->load(soundFile, WAV); 244 244 if (this->soundBuffers[action] != NULL) 245 245 { 246 PRINTF(4)("Loaded sound %s to action %s.\n", soundFile , actionToChar(action));246 PRINTF(4)("Loaded sound %s to action %s.\n", soundFile.c_str(), actionToChar(action)); 247 247 } 248 248 else 249 249 { 250 PRINTF(2)("Failed to load sound %s to %s.\n.", soundFile , actionToChar(action));250 PRINTF(2)("Failed to load sound %s to %s.\n.", soundFile.c_str(), actionToChar(action)); 251 251 } 252 252 } -
branches/std/src/world_entities/weapons/weapon.h
r7102 r7207 148 148 inline void setAmmoContainer(const CountPointer<AmmoContainer>& ammoContainer) { this->ammoContainer = ammoContainer;} 149 149 150 void setActionSound(WeaponAction action, const char*soundFile);150 void setActionSound(WeaponAction action, const std::string& soundFile); 151 151 /** @see void setActionSound(WeaponAction action, const char* soundFile); */ 152 152 void setActionSound(const char* action, const char* soundFile) { this->setActionSound(charToAction(action), soundFile); };
Note: See TracChangeset
for help on using the changeset viewer.