From 364cb376985d516dbbf175b53fc4e285e844e635 Mon Sep 17 00:00:00 2001 From: Caleb Butler Date: Sun, 3 Sep 2023 18:39:07 -0400 Subject: [PATCH] Remove deprecated methods from IVideoDriver --- include/IVideoDriver.h | 76 ++------------------------------- source/Irrlicht/CNullDriver.cpp | 41 ++---------------- source/Irrlicht/CNullDriver.h | 14 ++---- 3 files changed, 11 insertions(+), 120 deletions(-) diff --git a/include/IVideoDriver.h b/include/IVideoDriver.h index d26d75a5..d402061c 100644 --- a/include/IVideoDriver.h +++ b/include/IVideoDriver.h @@ -297,24 +297,6 @@ namespace video virtual ITexture* addTexture(const core::dimension2d& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0; - //! Creates a texture from an IImage. - /** \param name A name for the texture. Later calls of - getTexture() with this name will return this texture. - The name can _not_ be empty. - \param image Image the texture is created from. - \param mipmapData Optional pointer to a mipmaps data. - If this parameter is not given, the mipmaps are derived from image. - \return Pointer to the newly created texture. This pointer - should not be dropped. See IReferenceCounted::drop() for more - information. */ - _IRR_DEPRECATED_ ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData) - { - if (image) - image->setMipMapsData(mipmapData, false); - - return addTexture(name, image); - } - //! Creates a texture from an IImage. /** \param name A name for the texture. Later calls of getTexture() with this name will return this texture. @@ -458,15 +440,9 @@ namespace video color values may not be exactly the same in the engine and for example in picture edit programs. To avoid this problem, you could use the makeColorKeyTexture method, which takes the - position of a pixel instead a color value. - \param zeroTexels (deprecated) If set to true, then any texels that match - the color key will have their color, as well as their alpha, set to zero - (i.e. black). This behavior matches the legacy (buggy) behavior prior - to release 1.5 and is provided for backwards compatibility only. - This parameter may be removed by Irrlicht 1.9. */ + position of a pixel instead a color value. */ virtual void makeColorKeyTexture(video::ITexture* texture, - video::SColor color, - bool zeroTexels = false) const =0; + video::SColor color) const =0; //! Sets a boolean alpha channel on the texture based on the color at a position. /** This makes the texture fully transparent at the texels where @@ -475,15 +451,9 @@ namespace video \param texture Texture whose alpha channel is modified. \param colorKeyPixelPos Position of a pixel with the color key color. Every texel with this color will become fully transparent as - described above. - \param zeroTexels (deprecated) If set to true, then any texels that match - the color key will have their color, as well as their alpha, set to zero - (i.e. black). This behavior matches the legacy (buggy) behavior prior - to release 1.5 and is provided for backwards compatibility only. - This parameter may be removed by Irrlicht 1.9. */ + described above. */ virtual void makeColorKeyTexture(video::ITexture* texture, - core::position2d colorKeyPixelPos, - bool zeroTexels = false) const =0; + core::position2d colorKeyPixelPos) const =0; //! Set a render target. /** This will only work if the driver supports the @@ -1031,27 +1001,6 @@ namespace video See IReferenceCounted::drop() for more information. */ virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d& size) =0; - //! Creates a software image by converting it to given format from another image. - /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9. - \param format Desired color format of the image. - \param imageToCopy Image to copy to the new image. - \return The created image. - If you no longer need the image, you should call IImage::drop(). - See IReferenceCounted::drop() for more information. */ - _IRR_DEPRECATED_ virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) =0; - - //! Creates a software image from a part of another image. - /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9. - \param imageToCopy Image to copy to the new image in part. - \param pos Position of rectangle to copy. - \param size Extents of rectangle to copy. - \return The created image. - If you no longer need the image, you should call IImage::drop(). - See IReferenceCounted::drop() for more information. */ - _IRR_DEPRECATED_ virtual IImage* createImage(IImage* imageToCopy, - const core::position2d& pos, - const core::dimension2d& size) =0; - //! Creates a software image from a part of a texture. /** \param texture Texture to copy to the new image in part. @@ -1155,23 +1104,6 @@ namespace video //! Clear the color, depth and/or stencil buffers. virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) = 0; - //! Clear the color, depth and/or stencil buffers. - _IRR_DEPRECATED_ void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) - { - u16 flag = 0; - - if (backBuffer) - flag |= ECBF_COLOR; - - if (depthBuffer) - flag |= ECBF_DEPTH; - - if (stencilBuffer) - flag |= ECBF_STENCIL; - - clearBuffers(flag, color); - } - //! Clears the ZBuffer. /** Note that you usually need not to call this method, as it is automatically done in IVideoDriver::beginScene() or diff --git a/source/Irrlicht/CNullDriver.cpp b/source/Irrlicht/CNullDriver.cpp index 04e38646..b2d69145 100644 --- a/source/Irrlicht/CNullDriver.cpp +++ b/source/Irrlicht/CNullDriver.cpp @@ -869,8 +869,7 @@ const wchar_t* CNullDriver::getName() const //! Creates a boolean alpha channel of the texture based of an color key. void CNullDriver::makeColorKeyTexture(video::ITexture* texture, - video::SColor color, - bool zeroTexels) const + video::SColor color) const { if (!texture) return; @@ -905,12 +904,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture, // If the color matches the reference color, ignoring alphas, // set the alpha to zero. if(((*p) & 0x7fff) == refZeroAlpha) - { - if(zeroTexels) - (*p) = 0; - else - (*p) = refZeroAlpha; - } + (*p) = refZeroAlpha; ++p; } @@ -939,12 +933,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture, // If the color matches the reference color, ignoring alphas, // set the alpha to zero. if(((*p) & 0x00ffffff) == refZeroAlpha) - { - if(zeroTexels) - (*p) = 0; - else (*p) = refZeroAlpha; - } ++p; } @@ -958,8 +947,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture, //! Creates an boolean alpha channel of the texture based of an color key position. void CNullDriver::makeColorKeyTexture(video::ITexture* texture, - core::position2d colorKeyPixelPos, - bool zeroTexels) const + core::position2d colorKeyPixelPos) const { if (!texture) return; @@ -1004,7 +992,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture, } texture->unlock(); - makeColorKeyTexture(texture, colorKey, zeroTexels); + makeColorKeyTexture(texture, colorKey); } @@ -1242,27 +1230,6 @@ IImage* CNullDriver::createImage(ECOLOR_FORMAT format, const core::dimension2dgetDimension()); - imageToCopy->copyTo(tmp); - return tmp; -} - - -//! Creates a software image from part of another image. -IImage* CNullDriver::createImage(IImage* imageToCopy, const core::position2d& pos, const core::dimension2d& size) -{ - os::Printer::log("Deprecated method, please create an empty image instead and use copyTo().", ELL_WARNING); - CImage* tmp = new CImage(imageToCopy->getColorFormat(), imageToCopy->getDimension()); - imageToCopy->copyTo(tmp, core::position2di(0,0), core::recti(pos,size)); - return tmp; -} - - //! Creates a software image from part of a texture. IImage* CNullDriver::createImage(ITexture* texture, const core::position2d& pos, const core::dimension2d& size) { diff --git a/source/Irrlicht/CNullDriver.h b/source/Irrlicht/CNullDriver.h index 18c80f06..69b12d0a 100644 --- a/source/Irrlicht/CNullDriver.h +++ b/source/Irrlicht/CNullDriver.h @@ -296,11 +296,11 @@ namespace video const io::path& name, const ECOLOR_FORMAT format) override; //! Creates an 1bit alpha channel of the texture based of an color key. - void makeColorKeyTexture(video::ITexture* texture, video::SColor color, bool zeroTexels) const override; + void makeColorKeyTexture(video::ITexture* texture, video::SColor color) const override; //! Creates an 1bit alpha channel of the texture based of an color key position. - virtual void makeColorKeyTexture(video::ITexture* texture, core::position2d colorKeyPixelPos, - bool zeroTexels) const override; + virtual void makeColorKeyTexture(video::ITexture* texture, + core::position2d colorKeyPixelPos) const override; //! Returns the maximum amount of primitives (mostly vertices) which //! the device is able to render with one drawIndexedTriangleList @@ -328,14 +328,6 @@ namespace video //! Creates an empty software image. IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d& size) override; - //! Creates a software image from another image. - IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) override; - - //! Creates a software image from part of another image. - virtual IImage* createImage(IImage* imageToCopy, - const core::position2d& pos, - const core::dimension2d& size) override; - //! Creates a software image from part of a texture. virtual IImage* createImage(ITexture* texture, const core::position2d& pos,