16
Graphics / Sprite hit area, how to?
« on: October 03, 2010, 12:04:57 pm »
And the english: http://sfml-dev.org/wiki/en/sources/simple_collision_detection
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
(with 1000 hares)
for(std::map<string, sf::Image*>::iterator it = m_Images.begin(); it != m_Images.end(); ++it)
{
sf::Image* temp = (*it).second;
delete temp;
}
delete (*it).second;
Init is called from the main program, it is called just not shown in the code.
sf::Image* spriteManager::loadImage(string filename){
if(m_Images.find(filename) == m_Images.end()){
m_Temp = new sf::Image();
if (!m_Temp->LoadFromFile(filename)){
delete m_Temp;
LOG("[ERROR]: Loading sprite failed");
}else{
m_Images[filename] = m_Temp;
m_Temp = NULL;
}
}
return m_Images[filename];
}
sf::Image*& loadImage(string filename);