mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
racingcrashfix #4766
This commit is contained in:
parent
7c46102f0c
commit
ffe8bbd2dd
2 changed files with 14 additions and 3 deletions
|
@ -400,7 +400,10 @@ namespace NifOsg
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::ref_ptr<osg::Texture2D> texture2d (new osg::Texture2D(handleSourceTexture(textureEffect->texture.getPtr(), imageManager)));
|
osg::ref_ptr<osg::Image> image (handleSourceTexture(textureEffect->texture.getPtr(), imageManager));
|
||||||
|
osg::ref_ptr<osg::Texture2D> texture2d (new osg::Texture2D(image));
|
||||||
|
if (image)
|
||||||
|
texture2d->setTextureSize(image->s(), image->t());
|
||||||
texture2d->setName("envMap");
|
texture2d->setName("envMap");
|
||||||
unsigned int clamp = static_cast<unsigned int>(textureEffect->clamp);
|
unsigned int clamp = static_cast<unsigned int>(textureEffect->clamp);
|
||||||
int wrapT = (clamp) & 0x1;
|
int wrapT = (clamp) & 0x1;
|
||||||
|
@ -770,7 +773,10 @@ namespace NifOsg
|
||||||
wrapT = inherit->getWrap(osg::Texture2D::WRAP_T);
|
wrapT = inherit->getWrap(osg::Texture2D::WRAP_T);
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::ref_ptr<osg::Texture2D> texture (new osg::Texture2D(handleSourceTexture(st.getPtr(), imageManager)));
|
osg::ref_ptr<osg::Image> image (handleSourceTexture(st.getPtr(), imageManager));
|
||||||
|
osg::ref_ptr<osg::Texture2D> texture (new osg::Texture2D(image));
|
||||||
|
if (image)
|
||||||
|
texture->setTextureSize(image->s(), image->t());
|
||||||
texture->setWrap(osg::Texture::WRAP_S, wrapS);
|
texture->setWrap(osg::Texture::WRAP_S, wrapS);
|
||||||
texture->setWrap(osg::Texture::WRAP_T, wrapT);
|
texture->setWrap(osg::Texture::WRAP_T, wrapT);
|
||||||
textures.push_back(texture);
|
textures.push_back(texture);
|
||||||
|
@ -1337,6 +1343,8 @@ namespace NifOsg
|
||||||
const Nif::NiSourceTexture *st = tex.texture.getPtr();
|
const Nif::NiSourceTexture *st = tex.texture.getPtr();
|
||||||
osg::ref_ptr<osg::Image> image = handleSourceTexture(st, imageManager);
|
osg::ref_ptr<osg::Image> image = handleSourceTexture(st, imageManager);
|
||||||
texture2d = new osg::Texture2D(image);
|
texture2d = new osg::Texture2D(image);
|
||||||
|
if (image)
|
||||||
|
texture2d->setTextureSize(image->s(), image->t());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
texture2d = new osg::Texture2D;
|
texture2d = new osg::Texture2D;
|
||||||
|
|
|
@ -163,6 +163,7 @@ namespace Shader
|
||||||
if (image)
|
if (image)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Texture2D> normalMapTex (new osg::Texture2D(image));
|
osg::ref_ptr<osg::Texture2D> normalMapTex (new osg::Texture2D(image));
|
||||||
|
normalMapTex->setTextureSize(image->s(), image->t());
|
||||||
normalMapTex->setWrap(osg::Texture::WRAP_S, diffuseMap->getWrap(osg::Texture::WRAP_S));
|
normalMapTex->setWrap(osg::Texture::WRAP_S, diffuseMap->getWrap(osg::Texture::WRAP_S));
|
||||||
normalMapTex->setWrap(osg::Texture::WRAP_T, diffuseMap->getWrap(osg::Texture::WRAP_T));
|
normalMapTex->setWrap(osg::Texture::WRAP_T, diffuseMap->getWrap(osg::Texture::WRAP_T));
|
||||||
normalMapTex->setFilter(osg::Texture::MIN_FILTER, diffuseMap->getFilter(osg::Texture::MIN_FILTER));
|
normalMapTex->setFilter(osg::Texture::MIN_FILTER, diffuseMap->getFilter(osg::Texture::MIN_FILTER));
|
||||||
|
@ -186,7 +187,9 @@ namespace Shader
|
||||||
boost::replace_last(specularMapFileName, ".", mSpecularMapPattern + ".");
|
boost::replace_last(specularMapFileName, ".", mSpecularMapPattern + ".");
|
||||||
if (mImageManager.getVFS()->exists(specularMapFileName))
|
if (mImageManager.getVFS()->exists(specularMapFileName))
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Texture2D> specularMapTex (new osg::Texture2D(mImageManager.getImage(specularMapFileName)));
|
osg::ref_ptr<osg::Image> image (mImageManager.getImage(specularMapFileName));
|
||||||
|
osg::ref_ptr<osg::Texture2D> specularMapTex (new osg::Texture2D(image));
|
||||||
|
specularMapTex->setTextureSize(image->s(), image->t());
|
||||||
specularMapTex->setWrap(osg::Texture::WRAP_S, diffuseMap->getWrap(osg::Texture::WRAP_S));
|
specularMapTex->setWrap(osg::Texture::WRAP_S, diffuseMap->getWrap(osg::Texture::WRAP_S));
|
||||||
specularMapTex->setWrap(osg::Texture::WRAP_T, diffuseMap->getWrap(osg::Texture::WRAP_T));
|
specularMapTex->setWrap(osg::Texture::WRAP_T, diffuseMap->getWrap(osg::Texture::WRAP_T));
|
||||||
specularMapTex->setFilter(osg::Texture::MIN_FILTER, diffuseMap->getFilter(osg::Texture::MIN_FILTER));
|
specularMapTex->setFilter(osg::Texture::MIN_FILTER, diffuseMap->getFilter(osg::Texture::MIN_FILTER));
|
||||||
|
|
Loading…
Reference in a new issue