void SoundEmitter::setSoundClip(SoundClipPtr soundClip) { // equal clip if (m_soundClipId == soundClip->getHandle()) { return; } detachSoundClip(); m_soundClipId = soundClip->getHandle(); m_soundClip = soundClip; attachSoundClip(); }
void SoundClipManager::remove(SoundClipPtr& resource) { SoundClipHandleMapIterator it = m_sclipHandleMap.find(resource->getHandle()); SoundClipNameMapIterator nit = m_sclipNameMap.find(resource->getName()); if (it != m_sclipHandleMap.end()) { m_sclipHandleMap.erase(it); if (nit != m_sclipNameMap.end()) { m_sclipNameMap.erase(nit); return; } assert(false); //should never get here } FL_WARN(_log, LMsg("SoundClipManager::remove(ResourcePtr&) - ") << "Resource " << resource->getName() << " was not found."); }