From ff11053f5f638749c3564c464dc41ebc474b4897 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Jun 2012 22:46:34 +0300 Subject: Move static methods from Image class to ImageHelper class. Remove SDL merge method. It was very slow and unused. --- src/opengl1graphics.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/opengl1graphics.cpp') diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp index dbd983fb5..2bb6e06a2 100644 --- a/src/opengl1graphics.cpp +++ b/src/opengl1graphics.cpp @@ -30,6 +30,7 @@ #include "logger.h" #include "resources/image.h" +#include "resources/imagehelper.h" #include @@ -66,7 +67,7 @@ static inline void drawQuad(const Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height) { - if (image->mTextureType == GL_TEXTURE_2D) + if (ImageHelper::mTextureType == GL_TEXTURE_2D) { // Find OpenGL normalized texture coordinates. float texX1 = static_cast(srcX) @@ -104,7 +105,7 @@ static inline void drawRescaledQuad(Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height, int desiredWidth, int desiredHeight) { - if (image->mTextureType == GL_TEXTURE_2D) + if (ImageHelper::mTextureType == GL_TEXTURE_2D) { // Find OpenGL normalized texture coordinates. float texX1 = static_cast(srcX) @@ -152,7 +153,7 @@ bool OpenGL1Graphics::drawImage(const Image *image, int srcX, int srcY, if (!useColor) glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha); - bindTexture(Image::mTextureType, image->mGLImage); + bindTexture(ImageHelper::mTextureType, image->mGLImage); setTexturingAndBlending(true); @@ -212,7 +213,7 @@ bool OpenGL1Graphics::drawRescaledImage(Image *image, int srcX, int srcY, if (!useColor) glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha); - bindTexture(Image::mTextureType, image->mGLImage); + bindTexture(ImageHelper::mTextureType, image->mGLImage); setTexturingAndBlending(true); @@ -266,7 +267,7 @@ void OpenGL1Graphics::drawImagePattern(const Image *image, int x, int y, glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha); - bindTexture(Image::mTextureType, image->mGLImage); + bindTexture(ImageHelper::mTextureType, image->mGLImage); setTexturingAndBlending(true); @@ -312,7 +313,7 @@ void OpenGL1Graphics::drawRescaledImagePattern(Image *image, int x, int y, glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha); - bindTexture(Image::mTextureType, image->mGLImage); + bindTexture(ImageHelper::mTextureType, image->mGLImage); setTexturingAndBlending(true); @@ -628,7 +629,7 @@ void OpenGL1Graphics::setTexturingAndBlending(bool enable) { if (!mTexture) { - glEnable(Image::mTextureType); + glEnable(ImageHelper::mTextureType); mTexture = true; } @@ -654,7 +655,7 @@ void OpenGL1Graphics::setTexturingAndBlending(bool enable) if (mTexture) { - glDisable(Image::mTextureType); + glDisable(ImageHelper::mTextureType); mTexture = false; } } -- cgit v1.2.3-60-g2f50