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) ...@@ -98,14 +98,14 @@ HasMipMaps(false), IsRenderTarget(false)
//! destructor //! destructor
CD3D8Texture::~CD3D8Texture() CD3D8Texture::~CD3D8Texture()
{ {
if (Device)
Device->Release();
if (Texture) if (Texture)
Texture->Release(); Texture->Release();
if (RTTSurface) if (RTTSurface)
RTTSurface->Release(); RTTSurface->Release();
if (Device)
Device->Release();
} }
......
...@@ -95,14 +95,14 @@ HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(false) ...@@ -95,14 +95,14 @@ HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(false)
//! destructor //! destructor
CD3D9Texture::~CD3D9Texture() CD3D9Texture::~CD3D9Texture()
{ {
if (Device)
Device->Release();
if (Texture) if (Texture)
Texture->Release(); Texture->Release();
if (RTTSurface) if (RTTSurface)
RTTSurface->Release(); RTTSurface->Release();
if (Device)
Device->Release();
} }
......
...@@ -257,11 +257,13 @@ void CNullDriver::removeTexture(ITexture* texture) ...@@ -257,11 +257,13 @@ void CNullDriver::removeTexture(ITexture* texture)
return; return;
for (u32 i=0; i<Textures.size(); ++i) for (u32 i=0; i<Textures.size(); ++i)
{
if (Textures[i].Surface == texture) if (Textures[i].Surface == texture)
{ {
texture->drop(); texture->drop();
Textures.erase(i); Textures.erase(i);
} }
}
} }
......
...@@ -1803,8 +1803,13 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater ...@@ -1803,8 +1803,13 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
// texture address mode // texture address mode
for (u32 u=0; u<MaxTextureUnits; ++u) 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; GLint mode=GL_REPEAT;
switch (material.TextureLayer[u].TextureWrap) switch (material.TextureLayer[u].TextureWrap)
{ {
...@@ -1845,7 +1850,7 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater ...@@ -1845,7 +1850,7 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
else else
#endif #endif
// fallback // fallback
mode=GL_CLAMP_TO_EDGE; mode=GL_CLAMP;
break; break;
case ETC_MIRROR: case ETC_MIRROR:
#ifdef GL_VERSION_1_4 #ifdef GL_VERSION_1_4
...@@ -1867,10 +1872,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater ...@@ -1867,10 +1872,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
break; 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_S, mode);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 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