diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 86b82903e..5be11a20e 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -118,7 +118,7 @@ fgPanelVisible () map > FGTextureManager::_textureMap; osg::Texture2D* -FGTextureManager::createTexture (const string &relativePath) +FGTextureManager::createTexture (const string &relativePath, bool staticTexture) { osg::Texture2D* texture = _textureMap[relativePath].get(); if (texture == 0) { @@ -127,7 +127,7 @@ FGTextureManager::createTexture (const string &relativePath) SGPath tpath(globals->get_fg_root()); tpath.append(relativePath); - texture = SGLoadTexture2D(tpath); + texture = SGLoadTexture2D(staticTexture, tpath); _textureMap[relativePath] = texture; if (!_textureMap[relativePath].valid()) diff --git a/src/Cockpit/panel.hxx b/src/Cockpit/panel.hxx index af113c977..a8241b9d4 100644 --- a/src/Cockpit/panel.hxx +++ b/src/Cockpit/panel.hxx @@ -75,7 +75,8 @@ class FGPanelInstrument; class FGTextureManager { public: - static osg::Texture2D* createTexture(const string &relativePath); + static osg::Texture2D* createTexture(const string &relativePath, + bool staticTexture = true); static void addTexture(const string &relativePath, osg::Texture2D* texture); private: static map > _textureMap; diff --git a/src/Instrumentation/wxradar.cxx b/src/Instrumentation/wxradar.cxx index b83278cb3..fa71560b9 100644 --- a/src/Instrumentation/wxradar.cxx +++ b/src/Instrumentation/wxradar.cxx @@ -112,7 +112,8 @@ wxRadarBg::init () // texture name to use in 2D and 3D instruments _texture_path = _Instrument->getStringValue("radar-texture-path", "Aircraft/Instruments/Textures/od_wxradar.rgb"); - _resultTexture = FGTextureManager::createTexture(_texture_path.c_str()); + _resultTexture = FGTextureManager::createTexture(_texture_path.c_str(), + false); SGPath tpath(globals->get_fg_root()); string path = _Instrument->getStringValue("echo-texture-path", @@ -120,7 +121,7 @@ wxRadarBg::init () tpath.append(path); // no mipmap or else alpha will mix with pixels on the border of shapes, ruining the effect - _wxEcho = SGLoadTexture2D(tpath.c_str(), false, false); + _wxEcho = SGLoadTexture2D(tpath, false, false); _Instrument->setFloatValue("trk", 0.0);