Remove deprecated methods from IVideoDriver

This commit is contained in:
Caleb Butler 2023-09-03 18:39:07 -04:00 committed by sfan5
parent 7ce9169d8d
commit 364cb37698
3 changed files with 11 additions and 120 deletions

@ -297,24 +297,6 @@ namespace video
virtual ITexture* addTexture(const core::dimension2d<u32>& 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<s32> colorKeyPixelPos,
bool zeroTexels = false) const =0;
core::position2d<s32> 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<u32>& 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<s32>& pos,
const core::dimension2d<u32>& 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

@ -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;
}
@ -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<s32> colorKeyPixelPos,
bool zeroTexels) const
core::position2d<s32> 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::dimension2d<u
}
//! Creates a software image from another image.
IImage* CNullDriver::createImage(ECOLOR_FORMAT format, IImage *imageToCopy)
{
os::Printer::log("Deprecated method, please create an empty image instead and use copyTo().", ELL_WARNING);
CImage* tmp = new CImage(format, imageToCopy->getDimension());
imageToCopy->copyTo(tmp);
return tmp;
}
//! Creates a software image from part of another image.
IImage* CNullDriver::createImage(IImage* imageToCopy, const core::position2d<s32>& pos, const core::dimension2d<u32>& 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<s32>& pos, const core::dimension2d<u32>& size)
{

@ -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<s32> colorKeyPixelPos,
bool zeroTexels) const override;
virtual void makeColorKeyTexture(video::ITexture* texture,
core::position2d<s32> 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<u32>& 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<s32>& pos,
const core::dimension2d<u32>& size) override;
//! Creates a software image from part of a texture.
virtual IImage* createImage(ITexture* texture,
const core::position2d<s32>& pos,