Make resolution change more robust
This commit is contained in:
@@ -35,8 +35,10 @@
|
||||
#include "graphics/stkanimatedmesh.hpp"
|
||||
#include "graphics/stkbillboard.hpp"
|
||||
#include "graphics/stkmeshscenenode.hpp"
|
||||
#include "graphics/stkscenemanager.hpp"
|
||||
#include "graphics/sun.hpp"
|
||||
#include "graphics/rtts.hpp"
|
||||
#include "graphics/texturemanager.hpp"
|
||||
#include "graphics/water.hpp"
|
||||
#include "graphics/wind.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
@@ -804,6 +806,12 @@ void IrrDriver::applyResolutionSettings()
|
||||
// That's just error prone
|
||||
// (we're sure to update main.cpp at some point and forget this one...)
|
||||
m_shaders->killShaders();
|
||||
VAOManager::getInstance()->kill();
|
||||
SolidPassCmd::getInstance()->kill();
|
||||
ShadowPassCmd::getInstance()->kill();
|
||||
RSMPassCmd::getInstance()->kill();
|
||||
GlowPassCmd::getInstance()->kill();
|
||||
resetTextureTable();
|
||||
// initDevice will drop the current device.
|
||||
initDevice();
|
||||
|
||||
|
||||
@@ -16,10 +16,13 @@ GLuint getDepthTexture(irr::video::ITexture *tex)
|
||||
return static_cast<irr::video::COpenGLFBOTexture*>(tex)->DepthBufferTexture;
|
||||
}
|
||||
|
||||
std::set<irr::video::ITexture *> AlreadyTransformedTexture;
|
||||
static std::set<irr::video::ITexture *> AlreadyTransformedTexture;
|
||||
static std::map<int, video::ITexture*> unicolor_cache;
|
||||
|
||||
void resetTextureTable()
|
||||
{
|
||||
AlreadyTransformedTexture.clear();
|
||||
unicolor_cache.clear();
|
||||
}
|
||||
|
||||
void compressTexture(irr::video::ITexture *tex, bool srgb, bool premul_alpha)
|
||||
@@ -167,10 +170,6 @@ void saveCompressedTexture(const std::string& compressed_tex)
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
static unsigned colorcount = 0;
|
||||
|
||||
std::map<int, video::ITexture*> unicolor_cache;
|
||||
|
||||
video::ITexture* getUnicolorTexture(const video::SColor &c)
|
||||
{
|
||||
std::map<int, video::ITexture*>::iterator it = unicolor_cache.find(c.color);
|
||||
|
||||
Reference in New Issue
Block a user