Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7207 in orxonox.OLD for branches/std/src/world_entities/weapons


Ignore:
Timestamp:
Mar 9, 2006, 11:35:50 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: evil was within

Location:
branches/std/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/world_entities/weapons/weapon.cc

    r7193 r7207  
    232232 * @param soundFile the soundFile's relative position to the data-directory (will be looked for by the ResourceManager)
    233233 */
    234 void Weapon::setActionSound(WeaponAction action, const char* soundFile)
     234void Weapon::setActionSound(WeaponAction action, const std::string& soundFile)
    235235{
    236236  if (action >= WA_ACTION_COUNT)
     
    239239    ResourceManager::getInstance()->unload(this->soundBuffers[action]);
    240240
    241   else if (soundFile != NULL)
     241  else if (!soundFile.empty())
    242242  {
    243243    this->soundBuffers[action] = (SoundBuffer*)ResourceManager::getInstance()->load(soundFile, WAV);
    244244    if (this->soundBuffers[action] != NULL)
    245245    {
    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));
    247247    }
    248248    else
    249249    {
    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));
    251251    }
    252252  }
  • branches/std/src/world_entities/weapons/weapon.h

    r7102 r7207  
    148148    inline void setAmmoContainer(const CountPointer<AmmoContainer>& ammoContainer) { this->ammoContainer = ammoContainer;}
    149149
    150     void setActionSound(WeaponAction action, const char* soundFile);
     150    void setActionSound(WeaponAction action, const std::string& soundFile);
    151151    /** @see void setActionSound(WeaponAction action, const char* soundFile); */
    152152    void setActionSound(const char* action, const char* soundFile) { this->setActionSound(charToAction(action), soundFile); };
Note: See TracChangeset for help on using the changeset viewer.