Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/WolfireGames/overgrowth.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Graphics/textures.cpp')
-rw-r--r--Source/Graphics/textures.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Graphics/textures.cpp b/Source/Graphics/textures.cpp
index 2cccc64a..7a34bfd1 100644
--- a/Source/Graphics/textures.cpp
+++ b/Source/Graphics/textures.cpp
@@ -349,8 +349,8 @@ void Textures::DrawImGuiDebug() {
Textures::Textures() {
process_pool = new ProcessPool(worker_app_path);
PROFILED_TEXTURE_MUTEX_LOCK
- for(unsigned int i=0; i<_texture_units; i++){
- bound_texture[i]=INVALID_ID;
+ for(unsigned int & i : bound_texture){
+ i=INVALID_ID;
}
m_wrap_t = _default_wrap;
m_wrap_s = _default_wrap;
@@ -467,8 +467,8 @@ void Textures::DisposeTexture(int which, bool free_space) {
LOGI << "Disposed texture " << texture.name << " with gl id " << texture.gl_texture_id << std::endl;
}
- for (unsigned int i = 0; i < texture.sub_textures.size(); i++) {
- delete texture.sub_textures[i].texture_data;
+ for (auto & sub_texture : texture.sub_textures) {
+ delete sub_texture.texture_data;
}
texture.sub_textures.clear();
@@ -824,8 +824,7 @@ void Textures::TextureToVRAM(unsigned int which) {
CHECK_GL_ERROR();
if (!deferred_delete_textures.empty()) {
- for (std::list<GLuint>::iterator it = deferred_delete_textures.begin(); it != deferred_delete_textures.end(); it++) {
- GLuint tex_id = *it;
+ for (unsigned int tex_id : deferred_delete_textures) {
LOGI << "Deferred delete of texture " << tex_id << std::endl;
glDeleteTextures(1, &tex_id);
}
@@ -853,8 +852,8 @@ void Textures::TextureToVRAM(unsigned int which) {
if(tex.gl_texture_id != UNLOADED_ID)return;
- for( unsigned i = 0; i < tex.sub_textures.size(); i++ ) {
- tex.sub_textures[i].texture_data->EnsureInRAM();
+ for(auto & sub_texture : tex.sub_textures) {
+ sub_texture.texture_data->EnsureInRAM();
}
bool is_array = (tex.sub_textures.size() > 1);
@@ -2670,8 +2669,8 @@ bool Textures::ReloadAsCompressed(const TextureRef& texref) {
CreateParentDirs(newPath.c_str());
- for (unsigned int i = 0; i < texture.sub_textures.size(); i++) {
- TextureData *tex_data = texture.sub_textures[i].texture_data;
+ for (auto & sub_texture : texture.sub_textures) {
+ TextureData *tex_data = sub_texture.texture_data;
LOG_ASSERT(tex_data != NULL);
if (!tex_data->HasMipmaps()) {
tex_data->GenerateMipmaps();