SoundClipPtr SoundClipManager::add(SoundClip* res) {
		assert(res);
		assert(!(exists(res->getHandle()) || exists(res->getName())));

		SoundClipPtr resptr(res);

		std::pair<SoundClipHandleMapIterator, bool> returnValue;
		returnValue = m_sclipHandleMap.insert ( SoundClipHandleMapPair(res->getHandle(), resptr));

		if (returnValue.second) {
			m_sclipNameMap.insert ( SoundClipNameMapPair(returnValue.first->second->getName(), returnValue.first->second) );
		}
		else {
			FL_WARN(_log, LMsg("SoundClipManager::add(IResource*) - ") << "Resource " << res->getName() << " already exists.... ignoring.");
		}

		return returnValue.first->second;
	}
Exemple #2
0
	ImagePtr ImageManager::add(Image* res) {
		assert(res);
		assert(!(exists(res->getHandle()) || exists(res->getName())));

		ImagePtr resptr(res);

		std::pair<ImageHandleMapIterator, bool> returnValue;
		returnValue = m_imgHandleMap.insert ( ImageHandleMapPair(res->getHandle(), resptr));

		if (returnValue.second) {
			m_imgNameMap.insert ( ImageNameMapPair(returnValue.first->second->getName(), returnValue.first->second) );
		}
		else {
			FL_WARN(_log, LMsg("ImageManager::add(IResource*) - ") << "Resource " << res->getName() << " already exists.... ignoring.");
		}

		return returnValue.first->second;
	}