Commit 3a47e4f1 authored by Alexey Hohlov's avatar Alexey Hohlov
Browse files

CXX11

parent d28f4b61
......@@ -10,12 +10,13 @@ string& TextureManager::basedir(void) {
}
void TextureManager::clear(void) {
obj_map::iterator i;
Texture* o;
for (i = m_map.begin(); i != m_map.end(); i++) {
Texture* o = (*i).second;
glDeleteTextures(1, &o->texID);
delete o;
for (auto& i : m_map) {
o = i.second;
if (o) {
DeleteSpr(o);
}
}
m_map.clear();
......@@ -51,9 +52,13 @@ Sprite * TextureManager::load(string filename, CPoint orig, int frames_x, int fr
Texture * TextureManager::find(string& name)
{
obj_map::iterator i;
obj_map::iterator i;
i = m_map.find(name);
if(i==m_map.end()) return NULL;
if (i == m_map.end()) {
return NULL;
}
return ((*i).second);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment