summaryrefslogtreecommitdiff
path: root/src/guiscalingfilter.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-26 20:11:17 +0200
committerGitHub <noreply@github.com>2017-06-26 20:11:17 +0200
commitb3a36f7378ea0f299cfa36c81de42e00adb7292d (patch)
tree23d056b575ff0dba8cc759cc00f732099a1f3bce /src/guiscalingfilter.cpp
parenta8650e785df3f12efa5f8cd3c6a695fb9e22a598 (diff)
downloadminetest-b3a36f7378ea0f299cfa36c81de42e00adb7292d.tar.gz
minetest-b3a36f7378ea0f299cfa36c81de42e00adb7292d.tar.bz2
minetest-b3a36f7378ea0f299cfa36c81de42e00adb7292d.zip
Isolate irrlicht references and use a singleton (#6041)
* Add Device3D class which will contain IrrlichtDevice interface move getSupportedVideoDrivers to Device3D Add Device3D singleton & use it in various places Rename Device3D to Rendering engine & add helper functions to various device pointers More singleton work RenderingEngine owns draw_load_screen move draw functions to RenderingEngine Reduce IrrlichtDevice exposure and guienvironment RenderingEngine: Expose get_timer_time() to remove device from guiEngine Make irrlichtdevice & scene manager less exposed * Code style fixes * Move porting::getVideoDriverName, getVideoDriverFriendlyName, getDisplayDensity, getDisplaySize to RenderingEngine Fix XORG_USED macro -> RenderingEngine + create_engine_device from RenderingEngine constructor directly * enum paralax => enum parallax
Diffstat (limited to 'src/guiscalingfilter.cpp')
-rw-r--r--src/guiscalingfilter.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/guiscalingfilter.cpp b/src/guiscalingfilter.cpp
index 41cc72836..1b0dfac79 100644
--- a/src/guiscalingfilter.cpp
+++ b/src/guiscalingfilter.cpp
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h"
#include "util/numeric.h"
#include <stdio.h>
+#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,18 @@ 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)
+ 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);
+ if (it->second)
+ RenderingEngine::get_video_driver()->removeTexture(it->second);
}
g_txrCache.clear();
}