diff options
author | Alejandro Marzini | 2010-07-15 02:49:59 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-15 02:49:59 +0000 |
commit | d677ba5a1146ae48c0831e1056350d3efa2e43fd (patch) | |
tree | 506d515ab9eab85e7c0be2a0d474410bbad966ca /backends | |
parent | 69bf70d6933b76c0b79fd2bc8221587275aa35f4 (diff) | |
download | scummvm-rg350-d677ba5a1146ae48c0831e1056350d3efa2e43fd.tar.gz scummvm-rg350-d677ba5a1146ae48c0831e1056350d3efa2e43fd.tar.bz2 scummvm-rg350-d677ba5a1146ae48c0831e1056350d3efa2e43fd.zip |
Replaced nextHigher2, so CHAR_BIT define is not needed.
svn-id: r50904
Diffstat (limited to 'backends')
-rw-r--r-- | backends/graphics/opengl/gltexture.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp index 0a3e607d42..2d6927543f 100644 --- a/backends/graphics/opengl/gltexture.cpp +++ b/backends/graphics/opengl/gltexture.cpp @@ -41,14 +41,14 @@ static inline GLint xdiv(int numerator, int denominator) { return (numerator << 16) / denominator; } -template <class T> -static T nextHigher2(T k) { +static GLuint nextHigher2(GLuint k) { if (k == 0) return 1; - --k; - for (uint i = 1; i < sizeof(T) * CHAR_BIT; i <<= 1) - k = k | k >> i; - return k + 1; + GLuint nextPow = 1; + while (nextPow <= k) { + nextPow <<= 1; + } + return nextPow; } void GLTexture::initGLExtensions() { |