mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
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:
parent
13e995b811
commit
55ab4264dc
12 changed files with 100 additions and 118 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue