From fc54226a83c7b87909a2b56fe632be2208b0c0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 23 Jul 2017 00:23:59 +0200 Subject: [PATCH] Make internal function file-local and fix its name. --- src/Magnum/AbstractTexture.cpp | 20 ++++++++++++-------- src/Magnum/AbstractTexture.h | 5 ----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index a58548758..be8fd3b95 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -555,7 +555,9 @@ void AbstractTexture::bindInternal() { } #if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2) -PixelFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat internalFormat) { +namespace { + +PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { switch(internalFormat) { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) case TextureFormat::Red: @@ -815,7 +817,7 @@ PixelFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } -PixelType AbstractTexture::imageTypeForInternalFormat(const TextureFormat internalFormat) { +PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) { switch(internalFormat) { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) case TextureFormat::Red: @@ -1059,6 +1061,8 @@ PixelType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } + +} #endif void AbstractTexture::parameterImplementationDefault(GLenum parameter, GLint value) { @@ -1197,8 +1201,8 @@ void AbstractTexture::getLevelParameterImplementationDSAEXT(const GLint level, c #ifndef MAGNUM_TARGET_GLES void AbstractTexture::storageImplementationFallback(const GLsizei levels, const TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size) { - const PixelFormat format = imageFormatForInternalFormat(internalFormat); - const PixelType type = imageTypeForInternalFormat(internalFormat); + const PixelFormat format = pixelFormatForInternalFormat(internalFormat); + const PixelType type = pixelTypeForInternalFormat(internalFormat); for(GLsizei level = 0; level != levels; ++level) DataHelper<1>::setImage(*this, level, internalFormat, @@ -1222,8 +1226,8 @@ void AbstractTexture::storageImplementationDSAEXT(GLsizei levels, TextureFormat #if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2) void AbstractTexture::storageImplementationFallback(const GLsizei levels, const TextureFormat internalFormat, const Vector2i& size) { - const PixelFormat format = imageFormatForInternalFormat(internalFormat); - const PixelType type = imageTypeForInternalFormat(internalFormat); + const PixelFormat format = pixelFormatForInternalFormat(internalFormat); + const PixelType type = pixelTypeForInternalFormat(internalFormat); /* Common code for classic types */ #ifndef MAGNUM_TARGET_GLES @@ -1291,8 +1295,8 @@ void AbstractTexture::storageImplementationDSAEXT(GLsizei levels, TextureFormat #if !defined(MAGNUM_TARGET_GLES) || (defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) void AbstractTexture::storageImplementationFallback(GLsizei levels, TextureFormat internalFormat, const Vector3i& size) { - const PixelFormat format = imageFormatForInternalFormat(internalFormat); - const PixelType type = imageTypeForInternalFormat(internalFormat); + const PixelFormat format = pixelFormatForInternalFormat(internalFormat); + const PixelType type = pixelTypeForInternalFormat(internalFormat); /* Common code for classic type */ #ifndef MAGNUM_TARGET_GLES2 diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 7b9aada83..abef2a397 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -686,11 +686,6 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { void MAGNUM_LOCAL invalidateSubImageImplementationARB(GLint level, const Vector3i& offset, const Vector3i& size); #endif - #if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2) - PixelFormat MAGNUM_LOCAL imageFormatForInternalFormat(TextureFormat internalFormat); - PixelType MAGNUM_LOCAL imageTypeForInternalFormat(TextureFormat internalFormat); - #endif - GLuint _id; ObjectFlags _flags; };