]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/guiscalingfilter.cpp
Position entity nametags relative to selection-box (#7031)
[dragonfireclient.git] / src / guiscalingfilter.cpp
index 26a2265a8ab9bbc38c98cf02b3a3a267a59ce377..dc6219b60ba9b611f80d60786424283942a116b1 100644 (file)
@@ -20,7 +20,8 @@ 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
  * in a format that's manipulable by code.  Some platforms exhibit issues
@@ -48,18 +49,16 @@ void guiScalingCache(io::path key, video::IVideoDriver *driver, video::IImage *v
 }
 
 // Manually clear the cache, e.g. when switching to different worlds.
-void guiScalingCacheClear(video::IVideoDriver *driver)
+void guiScalingCacheClear()
 {
-       for (std::map<io::path, video::IImage *>::iterator it = g_imgCache.begin();
-                       it != g_imgCache.end(); it++) {
-               if (it->second != NULL)
-                       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 != NULL)
-                       driver->removeTexture(it->second);
+       for (auto &it : g_txrCache) {
+               if (it.second)
+                       RenderingEngine::get_video_driver()->removeTexture(it.second);
        }
        g_txrCache.clear();
 }