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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user