Prettied up some code.

This commit is contained in:
Alex Szpakowski
2014-08-26 00:05:08 -03:00
parent d5e5f38e2f
commit d6cd2e2e7e
3 changed files with 18 additions and 32 deletions
+4 -13
View File
@@ -43,26 +43,17 @@ Volatile::~Volatile()
bool Volatile::loadAll()
{
bool success = true;
std::list<Volatile *>::iterator i = all.begin();
while (i != all.end())
{
success = success && (*i)->loadVolatile();
i++;
}
for (Volatile *v : all)
success = success && v->loadVolatile();
return success;
}
void Volatile::unloadAll()
{
std::list<Volatile *>::iterator i = all.begin();
while (i != all.end())
{
(*i)->unloadVolatile();
i++;
}
for (Volatile *v : all)
v->unloadVolatile();
}
} // graphics
+3 -4
View File
@@ -521,11 +521,10 @@ void OpenGL::deleteTexture(GLuint texture)
{
// glDeleteTextures binds texture 0 to all texture units the deleted texture
// was bound to before deletion.
std::vector<GLuint>::iterator it;
for (it = state.textureUnits.begin(); it != state.textureUnits.end(); ++it)
for (GLuint &texid : state.textureUnits)
{
if (*it == texture)
*it = 0;
if (texid == texture)
texid = 0;
}
glDeleteTextures(1, &texture);