void NamedTextureMap::Register(const CString& cszName, TexturePtr spTexture) { if (IsTextureAvail(cszName)) m_uiSize -= m_mapAllTextures[cszName]->Size(); m_mapAllTextures[cszName] = spTexture; m_uiSize += spTexture->Size(); }
/// \exception throws exception when texture name isn't found. TexturePtr NamedTextureMap::Unregister(const CString& cszName) { if (!IsTextureAvail(cszName)) throw Exception(_T("Named texture not found: ") + cszName, __FILE__, __LINE__); T_mapAllTextures::const_iterator iter = m_mapAllTextures.find(cszName); TexturePtr spTex = iter->second; m_mapAllTextures.erase(iter); m_uiSize -= spTex->Size(); return spTex; }