diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2017-08-18 07:44:42 +0200 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2017-08-18 07:44:52 +0200 |
commit | 55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e (patch) | |
tree | a7b06056f0905327351131de60678f41a1283826 /src/guiscalingfilter.cpp | |
parent | 13e995b811e80dc48c0769274d3dca3a2221b843 (diff) | |
download | minetest-55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e.tar.gz minetest-55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e.tar.bz2 minetest-55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e.zip |
Modernize various files
* range-based for loops
* emplace_back instead of push_back
* code style
* C++ headers instead of C headers
* Default operators
* empty stl function
Diffstat (limited to 'src/guiscalingfilter.cpp')
-rw-r--r-- | src/guiscalingfilter.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/guiscalingfilter.cpp b/src/guiscalingfilter.cpp index 1b0dfac79..dc6219b60 100644 --- a/src/guiscalingfilter.cpp +++ b/src/guiscalingfilter.cpp @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "imagefilters.h" #include "settings.h" #include "util/numeric.h" -#include <stdio.h> +#include <cstdio> #include "client/renderingengine.h" /* Maintain a static cache to store the images that correspond to textures @@ -51,16 +51,14 @@ void guiScalingCache(io::path key, video::IVideoDriver *driver, video::IImage *v // Manually clear the cache, e.g. when switching to different worlds. void guiScalingCacheClear() { - for (std::map<io::path, video::IImage *>::iterator it = g_imgCache.begin(); - it != g_imgCache.end(); ++it) { - if (it->second) - it->second->drop(); + for (auto &it : g_imgCache) { + if (it.second) + it.second->drop(); } g_imgCache.clear(); - for (std::map<io::path, video::ITexture *>::iterator it = g_txrCache.begin(); - it != g_txrCache.end(); ++it) { - if (it->second) - RenderingEngine::get_video_driver()->removeTexture(it->second); + for (auto &it : g_txrCache) { + if (it.second) + RenderingEngine::get_video_driver()->removeTexture(it.second); } g_txrCache.clear(); } |