Don't attempt to open an empty texture

openmw-38
scrawl 9 years ago
parent d97dda05c9
commit a1fa1b2b2e

@ -1550,12 +1550,14 @@ void SkyManager::setWeather(const WeatherResult& weather)
{ {
mNextClouds = weather.mNextCloudTexture; mNextClouds = weather.mNextCloudTexture;
if (!mNextClouds.empty())
{
std::string texture = Misc::ResourceHelpers::correctTexturePath(mNextClouds, mSceneManager->getVFS()); std::string texture = Misc::ResourceHelpers::correctTexturePath(mNextClouds, mSceneManager->getVFS());
if (!texture.empty())
mCloudUpdater2->setTexture(mSceneManager->getTextureManager()->getTexture2D(texture, mCloudUpdater2->setTexture(mSceneManager->getTextureManager()->getTexture2D(texture,
osg::Texture::REPEAT, osg::Texture::REPEAT)); osg::Texture::REPEAT, osg::Texture::REPEAT));
} }
}
if (mCloudBlendFactor != weather.mCloudBlendFactor) if (mCloudBlendFactor != weather.mCloudBlendFactor)
{ {

Loading…
Cancel
Save