--- blobAndConquer-0.90/src/system/CGraphics.cpp~ 2007-05-22 17:33:50.000000000 +0200 +++ blobAndConquer-0.90/src/system/CGraphics.cpp 2007-05-22 17:33:50.000000000 +0200 @@ -604,8 +604,11 @@ Texture *Graphics::createTexture(SDL_Surface *surface) { - int w = Math::toNextPower(surface->w, 2); - int h = Math::toNextPower(surface->h, 2); + int w = 1; + int h = 1; + + while (w < surface->w) w <<= 1; + while (h < surface->h) h <<= 1; SDL_Surface *tmp = createSurface(w, h); --- blobAndConquer-0.90/src/system/CMath.h~ 2007-05-22 17:34:07.000000000 +0200 +++ blobAndConquer-0.90/src/system/CMath.h 2007-05-22 17:34:07.000000000 +0200 @@ -41,6 +41,5 @@ static float getDistance(float x1, float y1, float x2, float y2); static float getDistance(Vector v1, Vector v2); - static int toNextPower(int val, int power); }; --- blobAndConquer-0.90/src/system/CMath.cpp~ 2007-05-22 17:34:02.000000000 +0200 +++ blobAndConquer-0.90/src/system/CMath.cpp 2007-05-22 17:34:02.000000000 +0200 @@ -178,10 +178,3 @@ return (rtn == 0) ? 0 : sqrt(rtn); } - -int Math::toNextPower(int val, int power) -{ - double logbase2 = (log(val) / log(power)); - - return (int)(pow(power, ceil(logbase2)) + 0.5); -}