RageModelGeometry* ModelManager::LoadMilkshapeAscii( const CString& sFile, bool bNeedNormals ) { std::map<CString, RageModelGeometry*>::iterator p = m_mapFileToModel.find(sFile); if(p != m_mapFileToModel.end()) { /* Found the texture. Just increase the refcount and return it. */ RageModelGeometry* pModel = p->second; pModel->m_iRefCount++; return pModel; } RageModelGeometry* pModel = new RageModelGeometry; pModel->LoadMilkshapeAscii( sFile, bNeedNormals ); m_mapFileToModel[sFile] = pModel; return pModel; }
RageModelGeometry* ModelManager::LoadMilkshapeAscii( const std::string& sFile, bool bNeedNormals ) { auto p = m_mapFileToGeometry.find( sFile ); if( p != m_mapFileToGeometry.end() ) { /* Found the geometry. Just increase the refcount and return it. */ RageModelGeometry* pGeom = p->second; ++pGeom->m_iRefCount; return pGeom; } RageModelGeometry* pGeom = new RageModelGeometry; pGeom->LoadMilkshapeAscii( sFile, bNeedNormals ); m_mapFileToGeometry[sFile] = pGeom; return pGeom; }