Browse Source

Marking deprecated functions and types with CORRADE_DEPRECATED().

Sadly enum values can't be marked as such.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
79ff9e1ca4
  1. 2
      src/AbstractShaderProgram.h
  2. 2
      src/AbstractTexture.h
  3. 6
      src/Buffer.h
  4. 4
      src/ImageFormat.h
  5. 16
      src/Magnum.h
  6. 6
      src/Math/Geometry/Rectangle.h
  7. 2
      src/Sampler.h
  8. 4
      src/SceneGraph/Animable.h
  9. 2
      src/Swizzle.h
  10. 10
      src/Text/TextRenderer.h

2
src/AbstractShaderProgram.h

@ -340,7 +340,7 @@ class MAGNUM_EXPORT AbstractShaderProgram {
* @deprecated Use @ref Magnum::AbstractShaderProgram::maxVertexAttributes() "maxVertexAttributes()"
* instead.
*/
static Int maxSupportedVertexAttributeCount() { return maxVertexAttributes(); }
static CORRADE_DEPRECATED("use maxVertexAttributes() instead") Int maxSupportedVertexAttributeCount() { return maxVertexAttributes(); }
#endif
#ifndef MAGNUM_TARGET_GLES

2
src/AbstractTexture.h

@ -115,7 +115,7 @@ class MAGNUM_EXPORT AbstractTexture {
* @deprecated Use @ref Magnum::AbstractTexture::maxLayers() "maxLayers()"
* instead.
*/
static Int maxSupportedLayerCount() { return maxLayers(); }
static CORRADE_DEPRECATED("use maxLayers() instead") Int maxSupportedLayerCount() { return maxLayers(); }
#endif
#ifndef MAGNUM_TARGET_GLES

6
src/Buffer.h

@ -306,7 +306,7 @@ class MAGNUM_EXPORT Buffer {
* @copybrief BufferUsage
* @deprecated Use @ref Magnum::BufferUsage "BufferUsage" instead.
*/
typedef BufferUsage Usage;
typedef CORRADE_DEPRECATED("use BufferUsage instead") BufferUsage Usage;
#endif
/**
@ -653,7 +653,7 @@ class MAGNUM_EXPORT Buffer {
* @deprecated Use @ref Magnum::Buffer::setData(Containers::ArrayReference<const void>, BufferUsage) "setData(Containers::ArrayReference<const void>, BufferUsage)"
* instead.
*/
Buffer& setData(GLsizeiptr size, const GLvoid* data, BufferUsage usage) {
CORRADE_DEPRECATED("use setData(Containers::ArrayReference, BufferUsage) instead") Buffer& setData(GLsizeiptr size, const GLvoid* data, BufferUsage usage) {
return setData({data, std::size_t(size)}, usage);
}
#endif
@ -693,7 +693,7 @@ class MAGNUM_EXPORT Buffer {
* @deprecated Use @ref Magnum::Buffer::setSubData(GLintptr, Containers::ArrayReference<const void>) "setSubData(GLintptr, Containers::ArrayReference<const void>)"
* instead.
*/
Buffer& setSubData(GLintptr offset, GLsizeiptr size, const GLvoid* data) {
CORRADE_DEPRECATED("use setSubData(GLintptr, Containers::ArrayReference) instead") Buffer& setSubData(GLintptr offset, GLsizeiptr size, const GLvoid* data) {
return setSubData(offset, {data, std::size_t(size)});
}
#endif

4
src/ImageFormat.h

@ -38,13 +38,13 @@ namespace Magnum {
@copybrief ColorFormat
@deprecated Use @ref Magnum::ColorFormat "ColorFormat" instead.
*/
typedef ColorFormat ImageFormat;
typedef CORRADE_DEPRECATED("use ColorFormat instead") ColorFormat ImageFormat;
/**
@copybrief ColorType
@deprecated Use @ref Magnum::ColorType "ColorType" instead.
*/
typedef ColorType ImageType;
typedef CORRADE_DEPRECATED("use ColorType instead") ColorType ImageType;
}
#else

16
src/Magnum.h

@ -34,6 +34,10 @@
#include "Types.h"
#include "magnumConfigure.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Utility/Macros.h>
#endif
#ifndef DOXYGEN_GENERATING_OUTPUT
typedef unsigned int GLenum; /* Needed for *Format and *Type enums */
#endif
@ -330,15 +334,15 @@ typedef Math::Range3D<Int> Range3Di;
#ifdef MAGNUM_BUILD_DEPRECATED
/**
@copybrief Range2D
@deprecated Use @ref Magnum::Range2D instead.
@deprecated Use @ref Magnum::Range2D "Range2D" instead.
*/
typedef Math::Geometry::Rectangle<Float> Rectangle;
typedef CORRADE_DEPRECATED("use Range2D instead") Math::Geometry::Rectangle<Float> Rectangle;
/**
@copybrief Range2Di
@deprecated Use @ref Magnum::Range2Di instead.
@deprecated Use @ref Magnum::Range2Di "Range2Di" instead.
*/
typedef Math::Geometry::Rectangle<Int> Rectanglei;
typedef CORRADE_DEPRECATED("use Range2Di instead") Math::Geometry::Rectangle<Int> Rectanglei;
#endif
/*@}*/
@ -388,7 +392,7 @@ typedef Math::Matrix<2, Double> Matrix2x2d;
@copybrief Matrix2x2d
@deprecated Use @ref Magnum::Matrix2x2d "Matrix2x2d" instead.
*/
typedef Math::Matrix<2, Double> Matrix2d;
typedef CORRADE_DEPRECATED("use Matrix2x2d instead") Math::Matrix<2, Double> Matrix2d;
#endif
/**
@ -496,7 +500,7 @@ typedef Math::Range3D<Double> Range3Dd;
@copybrief Range2Dd
@deprecated Use @ref Magnum::Range2Dd instead.
*/
typedef Math::Geometry::Rectangle<Double> Rectangled;
typedef CORRADE_DEPRECATED("use Range2Dd instead") Math::Geometry::Rectangle<Double> Rectangled;
#endif
/*@}*/

6
src/Math/Geometry/Rectangle.h

@ -32,13 +32,15 @@
#include "Math/Range.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Utility/Macros.h>
namespace Magnum { namespace Math { namespace Geometry {
/**
@copybrief Math::Range2D
@deprecated Use @ref Magnum::Math::Range2D instead.
@deprecated Use @ref Magnum::Math::Range2D "Math::Range2D" instead.
*/
template<class T> class Rectangle: public Range2D<T> {
template<class T> class CORRADE_DEPRECATED("use Math::Range2D instead") Rectangle: public Range2D<T> {
public:
/** @copydoc Range2D() */
constexpr Rectangle() = default;

2
src/Sampler.h

@ -149,7 +149,7 @@ class MAGNUM_EXPORT Sampler {
* @deprecated Use @ref Magnum::Sampler::maxAnisotropy() "maxAnisotropy()"
* instead.
*/
static Float maxSupportedAnisotropy() { return maxAnisotropy(); }
static CORRADE_DEPRECATED("use maxAnisotropy() instead") Float maxSupportedAnisotropy() { return maxAnisotropy(); }
#endif
};

4
src/SceneGraph/Animable.h

@ -229,14 +229,14 @@ template<UnsignedInt dimensions, class T> class Animable: public AbstractGrouped
* @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()"
* instead.
*/
AnimableGroup<dimensions, T>* group() { return animables(); }
CORRADE_DEPRECATED("use animables() instead") AnimableGroup<dimensions, T>* group() { return animables(); }
/**
* @copydoc animables()
* @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()"
* instead.
*/
const AnimableGroup<dimensions, T>* group() const { return animables(); }
CORRADE_DEPRECATED("use animables() instead") const AnimableGroup<dimensions, T>* group() const { return animables(); }
#endif
protected:

2
src/Swizzle.h

@ -41,7 +41,7 @@ namespace Magnum {
@deprecated Use @ref Magnum::Math::swizzle() "Math::swizzle()" instead.
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<char ...components, class T> constexpr typename Math::Implementation::TypeForSize<sizeof...(components), T>::Type swizzle(const T& vector);
template<char ...components, class T> constexpr CORRADE_DEPRECATED("use Math::swizzle() instead") typename Math::Implementation::TypeForSize<sizeof...(components), T>::Type swizzle(const T& vector);
#else
using Math::swizzle;
#endif

10
src/Text/TextRenderer.h

@ -3,24 +3,24 @@
#include "Text/Renderer.h"
#ifdef MAGNUM_BUILD_DEPRECATED
namespace Magnum { namespace Text {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
@copybrief Renderer2D
@deprecated Use @ref Magnum::Text::Renderer2D "Renderer2D" instead.
*/
typedef Renderer<2> TextRenderer2D;
typedef CORRADE_DEPRECATED("use Renderer2D instead") Renderer<2> TextRenderer2D;
/**
@copybrief Renderer3D
@deprecated Use @ref Magnum::Text::Renderer3D "Renderer3D" instead.
*/
typedef Renderer<3> TextRenderer3D;
typedef CORRADE_DEPRECATED("use Renderer2D instead") Renderer<3> TextRenderer3D;
}}
#else
#error
#endif
}}
#endif

Loading…
Cancel
Save