Commit 47121936 authored by hybrid's avatar hybrid

Minor tweaks in cleanup.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1422 dfc29bdd-3216-0410-991c-e03cc46cb475
parent fd06e88d
......@@ -98,14 +98,14 @@ HasMipMaps(false), IsRenderTarget(false)
//! destructor
CD3D8Texture::~CD3D8Texture()
{
if (Device)
Device->Release();
if (Texture)
Texture->Release();
if (RTTSurface)
RTTSurface->Release();
if (Device)
Device->Release();
}
......
......@@ -95,14 +95,14 @@ HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(false)
//! destructor
CD3D9Texture::~CD3D9Texture()
{
if (Device)
Device->Release();
if (Texture)
Texture->Release();
if (RTTSurface)
RTTSurface->Release();
if (Device)
Device->Release();
}
......
......@@ -257,11 +257,13 @@ void CNullDriver::removeTexture(ITexture* texture)
return;
for (u32 i=0; i<Textures.size(); ++i)
{
if (Textures[i].Surface == texture)
{
texture->drop();
Textures.erase(i);
}
}
}
......
......@@ -1803,8 +1803,13 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
// texture address mode
for (u32 u=0; u<MaxTextureUnits; ++u)
{
if (resetAllRenderStates || lastmaterial.TextureLayer[u].TextureWrap != material.TextureLayer[u].TextureWrap)
if (resetAllRenderStates || (lastmaterial.TextureLayer[u].TextureWrap != material.TextureLayer[u].TextureWrap))
{
if (MultiTextureExtension)
extGlActiveTexture(GL_TEXTURE0_ARB + u);
else if (u>0)
break; // stop loop
GLint mode=GL_REPEAT;
switch (material.TextureLayer[u].TextureWrap)
{
......@@ -1845,7 +1850,7 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
else
#endif
// fallback
mode=GL_CLAMP_TO_EDGE;
mode=GL_CLAMP;
break;
case ETC_MIRROR:
#ifdef GL_VERSION_1_4
......@@ -1867,10 +1872,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
break;
}
if (MultiTextureExtension)
extGlActiveTexture(GL_TEXTURE0_ARB + u);
else if (u>0)
break;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, mode);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment