diff options
author | sfan5 <sfan5@live.de> | 2023-03-05 15:10:44 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-04-08 20:19:35 +0200 |
commit | 9d736e8b8baeeacad9cfa94edd18adfcaf000029 (patch) | |
tree | 6799a199edaeb82481edea6f101dc744b4507e9f /src/gui/guiEngine.cpp | |
parent | c26e122485a7180edf434c0c1211713ff377d6d7 (diff) | |
download | minetest-9d736e8b8baeeacad9cfa94edd18adfcaf000029.tar.xz |
Drop ENABLE_GLES option
ENABLE_GLES predates forking Irrlicht. Its primary use was to distinguish Irrlicht-ogles from upstream version as Minetest could be compiled with either.
That's not necessary anymore and gets in the way sometimes.
Diffstat (limited to 'src/gui/guiEngine.cpp')
-rw-r--r-- | src/gui/guiEngine.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index 54157c792..941ebe754 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -38,10 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/fontengine.h" #include "client/guiscalingfilter.h" #include "irrlicht_changes/static_text.h" - -#if ENABLE_GLES #include "client/tile.h" -#endif /******************************************************************************/ @@ -59,11 +56,15 @@ void TextDestGuiEngine::gotText(const std::wstring &text) /******************************************************************************/ MenuTextureSource::~MenuTextureSource() { - for (const std::string &texture_to_delete : m_to_delete) { - const char *tname = texture_to_delete.c_str(); - video::ITexture *texture = m_driver->getTexture(tname); - m_driver->removeTexture(texture); + u32 before = m_driver->getTextureCount(); + + for (const auto &it: m_to_delete) { + m_driver->removeTexture(it); } + m_to_delete.clear(); + + infostream << "~MenuTextureSource() before cleanup: "<< before + << " after: " << m_driver->getTextureCount() << std::endl; } /******************************************************************************/ @@ -75,7 +76,7 @@ video::ITexture *MenuTextureSource::getTexture(const std::string &name, u32 *id) if (name.empty()) return NULL; -#if ENABLE_GLES + // return if already loaded video::ITexture *retval = m_driver->findTexture(name.c_str()); if (retval) return retval; @@ -86,12 +87,11 @@ video::ITexture *MenuTextureSource::getTexture(const std::string &name, u32 *id) image = Align2Npot2(image, m_driver); retval = m_driver->addTexture(name.c_str(), image); - m_to_delete.insert(name); image->drop(); + + if (retval) + m_to_delete.push_back(retval); return retval; -#else - return m_driver->getTexture(name.c_str()); -#endif } /******************************************************************************/ |