[Scummvm-cvs-logs] SF.net SVN: scummvm:[50904] scummvm/branches/gsoc2010-opengl/backends/ graphics/opengl/gltexture.cpp
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Thu Jul 15 04:49:59 CEST 2010
Revision: 50904
http://scummvm.svn.sourceforge.net/scummvm/?rev=50904&view=rev
Author: vgvgf
Date: 2010-07-15 02:49:59 +0000 (Thu, 15 Jul 2010)
Log Message:
-----------
Replaced nextHigher2, so CHAR_BIT define is not needed.
Modified Paths:
--------------
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp 2010-07-15 02:45:49 UTC (rev 50903)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp 2010-07-15 02:49:59 UTC (rev 50904)
@@ -41,14 +41,14 @@
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() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list