Browse Source

GCC 4.6 compatibility: no template aliases.

Vladimír Vondruš 11 years ago
parent
commit
c5ae6b2d8d
  1. 4
      src/Magnum/AbstractTexture.cpp
  2. 4
      src/Magnum/AbstractTexture.h
  3. 4
      src/Magnum/DimensionTraits.h
  4. 2
      src/Magnum/SceneGraph/AbstractCamera.hpp
  5. 2
      src/Magnum/SceneGraph/AbstractTranslation.h
  6. 6
      src/Magnum/SceneGraph/AbstractTranslationRotation2D.h
  7. 6
      src/Magnum/SceneGraph/AbstractTranslationRotation3D.h
  8. 4
      src/Magnum/Texture.cpp
  9. 8
      src/Magnum/Texture.h
  10. 4
      src/Magnum/TextureArray.cpp
  11. 16
      src/Magnum/TextureArray.h

4
src/Magnum/AbstractTexture.cpp

@ -1261,7 +1261,7 @@ template void MAGNUM_EXPORT AbstractTexture::image<1>(GLint, BufferImage<1>&, Bu
template void MAGNUM_EXPORT AbstractTexture::image<2>(GLint, BufferImage<2>&, BufferUsage);
template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, BufferUsage);
template<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint level, const RangeTypeFor<dimensions, Int>& range, Image<dimensions>& image) {
template<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint level, const typename DimensionTraits<dimensions, Int>::RangeType& range, Image<dimensions>& image) {
createIfNotAlready();
const Math::Vector<dimensions, Int> size = range.size();
@ -1279,7 +1279,7 @@ template void MAGNUM_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&,
template void MAGNUM_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, Image<2>&);
template void MAGNUM_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, Image<3>&);
template<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint level, const RangeTypeFor<dimensions, Int>& range, BufferImage<dimensions>& image, const BufferUsage usage) {
template<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint level, const typename DimensionTraits<dimensions, Int>::RangeType& range, BufferImage<dimensions>& image, const BufferUsage usage) {
createIfNotAlready();
const Math::Vector<dimensions, Int> size = range.size();

4
src/Magnum/AbstractTexture.h

@ -381,8 +381,8 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
#ifndef MAGNUM_TARGET_GLES
template<UnsignedInt dimensions> void image(GLint level, Image<dimensions>& image);
template<UnsignedInt dimensions> void image(GLint level, BufferImage<dimensions>& image, BufferUsage usage);
template<UnsignedInt dimensions> void subImage(GLint level, const RangeTypeFor<dimensions, Int>& range, Image<dimensions>& image);
template<UnsignedInt dimensions> void subImage(GLint level, const RangeTypeFor<dimensions, Int>& range, BufferImage<dimensions>& image, BufferUsage usage);
template<UnsignedInt dimensions> void subImage(GLint level, const typename DimensionTraits<dimensions, Int>::RangeType& range, Image<dimensions>& image);
template<UnsignedInt dimensions> void subImage(GLint level, const typename DimensionTraits<dimensions, Int>::RangeType& range, BufferImage<dimensions>& image, BufferUsage usage);
#endif
GLenum _target;

4
src/Magnum/DimensionTraits.h

@ -103,7 +103,11 @@ template<class T> struct DimensionTraits<1, T> {
DimensionTraits() = delete;
typedef Math::Vector<1, T> VectorType;
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<T> RangeType;
#else
typedef Math::Range<1, T> RangeType;
#endif
};
/* Two dimensions - integral */

2
src/Magnum/SceneGraph/AbstractCamera.hpp

@ -47,7 +47,7 @@ template<UnsignedInt dimensions, class T> typename DimensionTraits<dimensions, T
/* Extend on larger side = scale larger side down
Clip on smaller side = scale smaller side up */
return MatrixTypeFor<dimensions, T>::scaling(Math::Vector<dimensions, T>::pad(
return DimensionTraits<dimensions, T>::MatrixType::scaling(Math::Vector<dimensions, T>::pad(
(relativeAspectRatio.x() > relativeAspectRatio.y()) == (aspectRatioPolicy == AspectRatioPolicy::Extend) ?
Vector2(relativeAspectRatio.y()/relativeAspectRatio.x(), T(1)) :
Vector2(T(1), relativeAspectRatio.x()/relativeAspectRatio.y()), T(1)));

2
src/Magnum/SceneGraph/AbstractTranslation.h

@ -88,7 +88,7 @@ class AbstractTranslation: public AbstractTransformation<dimensions, T> {
* or @ref Magnum::SceneGraph::AbstractTranslation::translateLocal() "translateLocal()"
* instead.
*/
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractTranslation<dimensions, T, TranslationType>& translate(const VectorTypeFor<dimensions, TranslationType>& vector, TransformationType type) {
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractTranslation<dimensions, T, TranslationType>& translate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type) {
return type == TransformationType::Global ? translate(vector) : translateLocal(vector);
}
#endif

6
src/Magnum/SceneGraph/AbstractTranslationRotation2D.h

@ -89,16 +89,16 @@ template<class T> class AbstractBasicTranslationRotation2D: public AbstractTrans
return *this;
}
AbstractBasicTranslationRotation2D<T>& translate(const Math::Vector2<T>& vector) {
AbstractBasicTranslation2D<T>::translate(vector);
AbstractTranslation<2, T>::translate(vector);
return *this;
}
AbstractBasicTranslationRotation2D<T>& translateLocal(const Math::Vector2<T>& vector) {
AbstractBasicTranslation2D<T>::translateLocal(vector);
AbstractTranslation<2, T>::translateLocal(vector);
return *this;
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotation2D<T>& translate(const Math::Vector2<T>& vector, TransformationType type) {
AbstractBasicTranslation2D<T>::translate(vector, type);
AbstractTranslation<2, T>::translate(vector, type);
return *this;
}
#endif

6
src/Magnum/SceneGraph/AbstractTranslationRotation3D.h

@ -213,16 +213,16 @@ template<class T> class AbstractBasicTranslationRotation3D: public AbstractTrans
return *this;
}
AbstractBasicTranslationRotation3D<T>& translate(const Math::Vector3<T>& vector) {
AbstractBasicTranslation3D<T>::translate(vector);
AbstractTranslation<3, T>::translate(vector);
return *this;
}
AbstractBasicTranslationRotation3D<T>& translateLocal(const Math::Vector3<T>& vector) {
AbstractBasicTranslation3D<T>::translateLocal(vector);
AbstractTranslation<3, T>::translateLocal(vector);
return *this;
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotation3D<T>& translate(const Math::Vector2<T>& vector, TransformationType type) {
AbstractBasicTranslation3D<T>::translate(vector, type);
AbstractTranslation<3, T>::translate(vector, type);
return *this;
}
#endif

4
src/Magnum/Texture.cpp

@ -83,7 +83,7 @@ template MAGNUM_EXPORT BufferImage<2> Texture<2>::image(Int, BufferImage<2>&&, B
template MAGNUM_EXPORT BufferImage<3> Texture<3>::image(Int, BufferImage<3>&&, BufferUsage);
#endif
template<UnsignedInt dimensions> Image<dimensions> Texture<dimensions>::subImage(const Int level, const RangeTypeFor<dimensions, Int>& range, Image<dimensions>&& image) {
template<UnsignedInt dimensions> Image<dimensions> Texture<dimensions>::subImage(const Int level, const typename DimensionTraits<dimensions, Int>::RangeType& range, Image<dimensions>&& image) {
this->subImage(level, range, image);
return std::move(image);
}
@ -94,7 +94,7 @@ template MAGNUM_EXPORT Image<2> Texture<2>::subImage(Int, const Range2Di&, Image
template MAGNUM_EXPORT Image<3> Texture<3>::subImage(Int, const Range3Di&, Image<3>&&);
#endif
template<UnsignedInt dimensions> BufferImage<dimensions> Texture<dimensions>::subImage(const Int level, const RangeTypeFor<dimensions, Int>& range, BufferImage<dimensions>&& image, const BufferUsage usage) {
template<UnsignedInt dimensions> BufferImage<dimensions> Texture<dimensions>::subImage(const Int level, const typename DimensionTraits<dimensions, Int>::RangeType& range, BufferImage<dimensions>&& image, const BufferUsage usage) {
this->subImage(level, range, image, usage);
return std::move(image);
}

8
src/Magnum/Texture.h

@ -712,7 +712,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround.
*/
void subImage(Int level, const RangeTypeFor<dimensions, Int>& range, Image<dimensions>& image) {
void subImage(Int level, const typename DimensionTraits<dimensions, Int>::RangeType& range, Image<dimensions>& image) {
AbstractTexture::subImage<dimensions>(level, range, image);
}
@ -723,7 +723,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* Image2D image = texture.subImage(0, rect, {ColorFormat::RGBA, ColorType::UnsignedByte});
* @endcode
*/
Image<dimensions> subImage(Int level, const RangeTypeFor<dimensions, Int>& range, Image<dimensions>&& image);
Image<dimensions> subImage(Int level, const typename DimensionTraits<dimensions, Int>::RangeType& range, Image<dimensions>&& image);
/**
* @brief Read range of given texture mip level to buffer image
@ -738,7 +738,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround.
*/
void subImage(Int level, const RangeTypeFor<dimensions, Int>& range, BufferImage<dimensions>& image, BufferUsage usage) {
void subImage(Int level, const typename DimensionTraits<dimensions, Int>::RangeType& range, BufferImage<dimensions>& image, BufferUsage usage) {
AbstractTexture::subImage<dimensions>(level, range, image, usage);
}
@ -749,7 +749,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* BufferImage2D image = texture.subImage(0, rect, {ColorFormat::RGBA, ColorType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage<dimensions> subImage(Int level, const RangeTypeFor<dimensions, Int>& range, BufferImage<dimensions>&& image, BufferUsage usage);
BufferImage<dimensions> subImage(Int level, const typename DimensionTraits<dimensions, Int>::RangeType& range, BufferImage<dimensions>&& image, BufferUsage usage);
#endif
/**

4
src/Magnum/TextureArray.cpp

@ -65,12 +65,12 @@ template<UnsignedInt dimensions> BufferImage<dimensions+1> TextureArray<dimensio
return std::move(image);
}
template<UnsignedInt dimensions> Image<dimensions+1> TextureArray<dimensions>::subImage(const Int level, const RangeTypeFor<dimensions+1, Int>& range, Image<dimensions+1>&& image) {
template<UnsignedInt dimensions> Image<dimensions+1> TextureArray<dimensions>::subImage(const Int level, const typename DimensionTraits<dimensions+1, Int>::RangeType& range, Image<dimensions+1>&& image) {
this->subImage(level, range, image);
return std::move(image);
}
template<UnsignedInt dimensions> BufferImage<dimensions+1> TextureArray<dimensions>::subImage(const Int level, const RangeTypeFor<dimensions+1, Int>& range, BufferImage<dimensions+1>&& image, const BufferUsage usage) {
template<UnsignedInt dimensions> BufferImage<dimensions+1> TextureArray<dimensions>::subImage(const Int level, const typename DimensionTraits<dimensions+1, Int>::RangeType& range, BufferImage<dimensions+1>&& image, const BufferUsage usage) {
this->subImage(level, range, image, usage);
return std::move(image);
}

16
src/Magnum/TextureArray.h

@ -390,15 +390,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
BufferImage<dimensions+1> image(Int level, BufferImage<dimensions+1>&& image, BufferUsage usage);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* @copybrief Texture::subImage(Int, const typename DimensionTraits<dimensions, Int>::RangeType&, Image&)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* See @ref Texture::subImage(Int, const typename DimensionTraits<dimensions, Int>::RangeType&, Image&)
* for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround.
*/
void subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, Image<dimensions+1>& image) {
void subImage(Int level, const typename DimensionTraits<dimensions+1, Int>::RangeType& range, Image<dimensions+1>& image) {
AbstractTexture::subImage<dimensions+1>(level, range, image);
}
@ -409,18 +409,18 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* Image3D image = texture.subImage(0, range, {ColorFormat::RGBA, ColorType::UnsignedByte});
* @endcode
*/
Image<dimensions+1> subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, Image<dimensions+1>&& image);
Image<dimensions+1> subImage(Int level, const typename DimensionTraits<dimensions+1, Int>::RangeType& range, Image<dimensions+1>&& image);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* @copybrief Texture::subImage(Int, const typename DimensionTraits<dimensions, Int>::RangeType&, BufferImage&, BufferUsage)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* See @ref Texture::subImage(Int, const typename DimensionTraits<dimensions, Int>::RangeType&, BufferImage&, BufferUsage)
* for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround.
*/
void subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, BufferImage<dimensions+1>& image, BufferUsage usage) {
void subImage(Int level, const typename DimensionTraits<dimensions+1, Int>::RangeType& range, BufferImage<dimensions+1>& image, BufferUsage usage) {
AbstractTexture::subImage<dimensions+1>(level, range, image, usage);
}
@ -431,7 +431,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* BufferImage3D image = texture.subImage(0, range, {ColorFormat::RGBA, ColorType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage<dimensions+1> subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, BufferImage<dimensions+1>&& image, BufferUsage usage);
BufferImage<dimensions+1> subImage(Int level, const typename DimensionTraits<dimensions+1, Int>::RangeType& range, BufferImage<dimensions+1>&& image, BufferUsage usage);
#endif
/**

Loading…
Cancel
Save