diff --git a/include/IRenderTarget.h b/include/IRenderTarget.h index ffe00a4..b95f701 100644 --- a/include/IRenderTarget.h +++ b/include/IRenderTarget.h @@ -39,7 +39,7 @@ namespace video //! Returns an array of previously set textures. const core::array& getTexture() const { - return Texture; + return Textures; } //! Returns a of previously set depth / depth-stencil texture. @@ -87,7 +87,7 @@ namespace video protected: //! Textures assigned to render target. - core::array Texture; + core::array Textures; //! Depth or packed depth-stencil texture assigned to render target. ITexture* DepthStencil; diff --git a/source/Irrlicht/CD3D9RenderTarget.cpp b/source/Irrlicht/CD3D9RenderTarget.cpp index 630c428..f39fb51 100644 --- a/source/Irrlicht/CD3D9RenderTarget.cpp +++ b/source/Irrlicht/CD3D9RenderTarget.cpp @@ -30,36 +30,36 @@ namespace irr CD3D9RenderTarget::~CD3D9RenderTarget() { - for (u32 i = 0; i < Surface.size(); ++i) + for (u32 i = 0; i < Surfaces.size(); ++i) { - if (Surface[i]) - Surface[i]->Release(); + if (Surfaces[i]) + Surfaces[i]->Release(); } if (DepthStencilSurface) DepthStencilSurface->Release(); - for (u32 i = 0; i < Texture.size(); ++i) + for (u32 i = 0; i < Textures.size(); ++i) { - if (Texture[i]) - Texture[i]->drop(); + if (Textures[i]) + Textures[i]->drop(); } if (DepthStencil) DepthStencil->drop(); } - void CD3D9RenderTarget::setTexture(const core::array& texture, ITexture* depthStencil, const core::array& cubeSurfaces) + void CD3D9RenderTarget::setTexture(const core::array& textures, ITexture* depthStencil, const core::array& cubeSurfaces) { bool needSizeUpdate = false; // Set color attachments. - if ((Texture != texture) || (CubeSurfaces != cubeSurfaces)) + if ((Textures != textures) || (CubeSurfaces != cubeSurfaces)) { needSizeUpdate = true; CubeSurfaces = cubeSurfaces; // TODO: we can probably avoid some memory allocating/de-allocating if _only_ CubeSurfaces change. - if (texture.size() > Driver->ActiveRenderTarget.size()) + if (textures.size() > Driver->ActiveRenderTarget.size()) { core::stringc message = "This GPU supports up to "; message += Driver->ActiveRenderTarget.size(); @@ -68,23 +68,23 @@ namespace irr os::Printer::log(message.c_str(), ELL_WARNING); } - const u32 size = core::min_(texture.size(), static_cast(Driver->ActiveRenderTarget.size())); + const u32 size = core::min_(textures.size(), static_cast(Driver->ActiveRenderTarget.size())); - for (u32 i = 0; i < Surface.size(); ++i) + for (u32 i = 0; i < Surfaces.size(); ++i) { - if (Surface[i]) - Surface[i]->Release(); + if (Surfaces[i]) + Surfaces[i]->Release(); } - Surface.set_used(size); + Surfaces.set_used(size); - core::array prevTextures(Texture); + core::array prevTextures(Textures); - Texture.set_used(size); + Textures.set_used(size); for (u32 i = 0; i < size; ++i) { - CD3D9Texture* currentTexture = (texture[i] && texture[i]->getDriverType() == DriverType) ? static_cast(texture[i]) : 0; + CD3D9Texture* currentTexture = (textures[i] && textures[i]->getDriverType() == DriverType) ? static_cast(textures[i]) : 0; IDirect3DTexture9* textureID = 0; IDirect3DCubeTexture9* cubeTextureId = 0; @@ -100,29 +100,29 @@ namespace irr if (textureID) { - Texture[i] = texture[i]; - Texture[i]->grab(); + Textures[i] = textures[i]; + Textures[i]->grab(); IDirect3DSurface9* currentSurface = 0; textureID->GetSurfaceLevel(level, ¤tSurface); - Surface[i] = currentSurface; + Surfaces[i] = currentSurface; } else if ( cubeTextureId ) { - Texture[i] = texture[i]; - Texture[i]->grab(); + Textures[i] = textures[i]; + Textures[i]->grab(); IDirect3DSurface9* currentSurface = 0; D3DCUBEMAP_FACES face = (D3DCUBEMAP_FACES)CubeSurfaces[i]; // we use same numbering cubeTextureId->GetCubeMapSurface(face, level, ¤tSurface); - Surface[i] = currentSurface; + Surfaces[i] = currentSurface; } else { - Surface[i] = 0; - Texture[i] = 0; + Surfaces[i] = 0; + Textures[i] = 0; } } @@ -189,11 +189,11 @@ namespace irr bool sizeDetected = false; - for (u32 i = 0; i < Texture.size(); ++i) + for (u32 i = 0; i < Textures.size(); ++i) { - if (Texture[i]) + if (Textures[i]) { - Size = Texture[i]->getSize(); + Size = Textures[i]->getSize(); sizeDetected = true; break; @@ -217,12 +217,12 @@ namespace irr IDirect3DSurface9* CD3D9RenderTarget::getSurface(u32 id) const { - return (id < Surface.size()) ? Surface[id] : 0; + return (id < Surfaces.size()) ? Surfaces[id] : 0; } u32 CD3D9RenderTarget::getSurfaceCount() const { - return Surface.size(); + return Surfaces.size(); } IDirect3DSurface9* CD3D9RenderTarget::getDepthStencilSurface() const @@ -232,12 +232,12 @@ namespace irr void CD3D9RenderTarget::releaseSurfaces() { - for (u32 i = 0; i < Surface.size(); ++i) + for (u32 i = 0; i < Surfaces.size(); ++i) { - if (Surface[i]) + if (Surfaces[i]) { - Surface[i]->Release(); - Surface[i] = 0; + Surfaces[i]->Release(); + Surfaces[i] = 0; } } @@ -250,16 +250,16 @@ namespace irr void CD3D9RenderTarget::generateSurfaces() { - for (u32 i = 0; i < Surface.size(); ++i) + for (u32 i = 0; i < Surfaces.size(); ++i) { - if (!Surface[i] && Texture[i]) + if (!Surfaces[i] && Textures[i]) { - IDirect3DTexture9* currentTexture = static_cast(Texture[i])->getDX9Texture(); + IDirect3DTexture9* currentTexture = static_cast(Textures[i])->getDX9Texture(); if ( currentTexture ) { IDirect3DSurface9* currentSurface = 0; currentTexture->GetSurfaceLevel(0, ¤tSurface); - Surface[i] = currentSurface; + Surfaces[i] = currentSurface; } } } diff --git a/source/Irrlicht/CD3D9RenderTarget.h b/source/Irrlicht/CD3D9RenderTarget.h index 1f643f0..f473ce9 100644 --- a/source/Irrlicht/CD3D9RenderTarget.h +++ b/source/Irrlicht/CD3D9RenderTarget.h @@ -46,7 +46,7 @@ namespace irr protected: core::dimension2d Size; - core::array Surface; + core::array Surfaces; IDirect3DSurface9* DepthStencilSurface; diff --git a/source/Irrlicht/COpenGLCoreRenderTarget.h b/source/Irrlicht/COpenGLCoreRenderTarget.h index 34f2cf3..7432b0f 100644 --- a/source/Irrlicht/COpenGLCoreRenderTarget.h +++ b/source/Irrlicht/COpenGLCoreRenderTarget.h @@ -37,10 +37,10 @@ public: if (ColorAttachment > 0) Driver->irrGlGenFramebuffers(1, &BufferID); - AssignedTexture.set_used(static_cast(ColorAttachment)); + AssignedTextures.set_used(static_cast(ColorAttachment)); - for (u32 i = 0; i < AssignedTexture.size(); ++i) - AssignedTexture[i] = GL_NONE; + for (u32 i = 0; i < AssignedTextures.size(); ++i) + AssignedTextures[i] = GL_NONE; } virtual ~COpenGLCoreRenderTarget() @@ -48,10 +48,10 @@ public: if (ColorAttachment > 0 && BufferID != 0) Driver->irrGlDeleteFramebuffers(1, &BufferID); - for (u32 i = 0; i < Texture.size(); ++i) + for (u32 i = 0; i < Textures.size(); ++i) { - if (Texture[i]) - Texture[i]->drop(); + if (Textures[i]) + Textures[i]->drop(); } if (DepthStencil) @@ -63,11 +63,11 @@ public: bool needSizeUpdate = false; // Set color attachments. - if ((Texture != textures) || (CubeSurfaces != cubeSurfaces)) + if ((Textures != textures) || (CubeSurfaces != cubeSurfaces)) { needSizeUpdate = true; - core::array prevTextures(Texture); + core::array prevTextures(Textures); if (textures.size() > static_cast(ColorAttachment)) { @@ -78,9 +78,9 @@ public: os::Printer::log(message.c_str(), ELL_WARNING); } - Texture.set_used(core::min_(textures.size(), static_cast(ColorAttachment))); + Textures.set_used(core::min_(textures.size(), static_cast(ColorAttachment))); - for (u32 i = 0; i < Texture.size(); ++i) + for (u32 i = 0; i < Textures.size(); ++i) { TOpenGLTexture* currentTexture = (textures[i] && textures[i]->getDriverType() == DriverType) ? static_cast(textures[i]) : 0; @@ -93,12 +93,12 @@ public: if (textureID != 0) { - Texture[i] = textures[i]; - Texture[i]->grab(); + Textures[i] = textures[i]; + Textures[i]->grab(); } else { - Texture[i] = 0; + Textures[i] = 0; } } @@ -183,26 +183,26 @@ public: { // Set new color textures. - const u32 textureSize = core::min_(Texture.size(), AssignedTexture.size()); + const u32 textureSize = core::min_(Textures.size(), AssignedTextures.size()); for (u32 i = 0; i < textureSize; ++i) { - TOpenGLTexture* currentTexture = static_cast(Texture[i]); + TOpenGLTexture* currentTexture = static_cast(Textures[i]); GLuint textureID = currentTexture ? currentTexture->getOpenGLTextureName() : 0; if (textureID != 0) { - AssignedTexture[i] = GL_COLOR_ATTACHMENT0 + i; + AssignedTextures[i] = GL_COLOR_ATTACHMENT0 + i; GLenum textarget = currentTexture->getType() == ETT_2D ? GL_TEXTURE_2D : GL_TEXTURE_CUBE_MAP_POSITIVE_X + (int)CubeSurfaces[i]; - Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], textarget, textureID, 0); + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTextures[i], textarget, textureID, 0); #ifdef _DEBUG Driver->testGLError(__LINE__); #endif } - else if (AssignedTexture[i] != GL_NONE) + else if (AssignedTextures[i] != GL_NONE) { - AssignedTexture[i] = GL_NONE; - Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], GL_TEXTURE_2D, 0, 0); + AssignedTextures[i] = GL_NONE; + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTextures[i], GL_TEXTURE_2D, 0, 0); os::Printer::log("Error: Could not set render target.", ELL_ERROR); } @@ -210,12 +210,12 @@ public: // Reset other render target channels. - for (u32 i = textureSize; i < AssignedTexture.size(); ++i) + for (u32 i = textureSize; i < AssignedTextures.size(); ++i) { - if (AssignedTexture[i] != GL_NONE) + if (AssignedTextures[i] != GL_NONE) { - Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], GL_TEXTURE_2D, 0, 0); - AssignedTexture[i] = GL_NONE; + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTextures[i], GL_TEXTURE_2D, 0, 0); + AssignedTextures[i] = GL_NONE; } } @@ -272,7 +272,7 @@ public: if (ColorAttachment > 0 && BufferID != 0) { - const u32 textureSize = Texture.size(); + const u32 textureSize = Textures.size(); if (textureSize == 0) Driver->irrGlDrawBuffer(GL_NONE); @@ -280,9 +280,9 @@ public: Driver->irrGlDrawBuffer(GL_COLOR_ATTACHMENT0); else { - const u32 bufferCount = core::min_(MultipleRenderTarget, core::min_(textureSize, AssignedTexture.size())); + const u32 bufferCount = core::min_(MultipleRenderTarget, core::min_(textureSize, AssignedTextures.size())); - Driver->irrGlDrawBuffers(bufferCount, AssignedTexture.pointer()); + Driver->irrGlDrawBuffers(bufferCount, AssignedTextures.pointer()); } #ifdef _DEBUG @@ -309,10 +309,10 @@ public: ITexture* getTexture() const { - for (u32 i = 0; i < Texture.size(); ++i) + for (u32 i = 0; i < Textures.size(); ++i) { - if (Texture[i]) - return Texture[i]; + if (Textures[i]) + return Textures[i]; } return 0; @@ -359,7 +359,7 @@ protected: return false; } - core::array AssignedTexture; + core::array AssignedTextures; bool AssignedDepth; bool AssignedStencil; diff --git a/source/Irrlicht/CSoftwareTexture.cpp b/source/Irrlicht/CSoftwareTexture.cpp index 8a0b507..11eb897 100644 --- a/source/Irrlicht/CSoftwareTexture.cpp +++ b/source/Irrlicht/CSoftwareTexture.cpp @@ -119,30 +119,30 @@ CSoftwareRenderTarget::CSoftwareRenderTarget(CSoftwareDriver* driver) : Driver(d { DriverType = EDT_SOFTWARE; - Texture.set_used(1); - Texture[0] = 0; + Textures.set_used(1); + Textures[0] = 0; } CSoftwareRenderTarget::~CSoftwareRenderTarget() { - if (Texture[0]) - Texture[0]->drop(); + if (Textures[0]) + Textures[0]->drop(); } -void CSoftwareRenderTarget::setTexture(const core::array& texture, ITexture* depthStencil, const core::array& cubeSurfaces) +void CSoftwareRenderTarget::setTexture(const core::array& textures, ITexture* depthStencil, const core::array& cubeSurfaces) { - if (Texture != texture) + if (Textures != textures) { - ITexture* prevTexture = Texture[0]; + ITexture* prevTexture = Textures[0]; bool textureDetected = false; - for (u32 i = 0; i < texture.size(); ++i) + for (u32 i = 0; i < textures.size(); ++i) { - if (texture[i] && texture[i]->getDriverType() == EDT_SOFTWARE) + if (textures[i] && textures[i]->getDriverType() == EDT_SOFTWARE) { - Texture[0] = texture[i]; - Texture[0]->grab(); + Textures[0] = textures[i]; + Textures[0]->grab(); textureDetected = true; break; @@ -153,13 +153,13 @@ void CSoftwareRenderTarget::setTexture(const core::array& texture, IT prevTexture->drop(); if (!textureDetected) - Texture[0] = 0; + Textures[0] = 0; } } ITexture* CSoftwareRenderTarget::getTexture() const { - return Texture[0]; + return Textures[0]; } diff --git a/source/Irrlicht/CSoftwareTexture2.cpp b/source/Irrlicht/CSoftwareTexture2.cpp index c4eb6fe..254c631 100644 --- a/source/Irrlicht/CSoftwareTexture2.cpp +++ b/source/Irrlicht/CSoftwareTexture2.cpp @@ -385,30 +385,30 @@ CSoftwareRenderTarget2::CSoftwareRenderTarget2(CBurningVideoDriver* driver) : Dr { DriverType = EDT_BURNINGSVIDEO; - Texture.set_used(1); - Texture[0] = 0; + Textures.set_used(1); + Textures[0] = 0; } CSoftwareRenderTarget2::~CSoftwareRenderTarget2() { - if (Texture[0]) - Texture[0]->drop(); + if (Textures[0]) + Textures[0]->drop(); } -void CSoftwareRenderTarget2::setTexture(const core::array& texture, ITexture* depthStencil, const core::array& cubeSurfaces) +void CSoftwareRenderTarget2::setTexture(const core::array& textures, ITexture* depthStencil, const core::array& cubeSurfaces) { - if (Texture != texture) + if (Textures != textures) { - ITexture* prevTexture = Texture[0]; + ITexture* prevTexture = Textures[0]; bool textureDetected = false; - for (u32 i = 0; i < texture.size(); ++i) + for (u32 i = 0; i < textures.size(); ++i) { - if (texture[i] && texture[i]->getDriverType() == EDT_BURNINGSVIDEO) + if (textures[i] && textures[i]->getDriverType() == EDT_BURNINGSVIDEO) { - Texture[0] = texture[i]; - Texture[0]->grab(); + Textures[0] = textures[i]; + Textures[0]->grab(); textureDetected = true; break; @@ -419,7 +419,7 @@ void CSoftwareRenderTarget2::setTexture(const core::array& texture, I prevTexture->drop(); if (!textureDetected) - Texture[0] = 0; + Textures[0] = 0; } }