summaryrefslogtreecommitdiff
path: root/src/opengl1graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-09 22:46:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-09 23:50:09 +0300
commitff11053f5f638749c3564c464dc41ebc474b4897 (patch)
tree8cf7ed8485528c7498612199c7ca56a6fd84f5e5 /src/opengl1graphics.cpp
parentb2c1c301b1e39fbbbb5bde3d4d55d14a9873b51f (diff)
downloadmv-ff11053f5f638749c3564c464dc41ebc474b4897.tar.gz
mv-ff11053f5f638749c3564c464dc41ebc474b4897.tar.bz2
mv-ff11053f5f638749c3564c464dc41ebc474b4897.tar.xz
mv-ff11053f5f638749c3564c464dc41ebc474b4897.zip
Move static methods from Image class to ImageHelper class.
Remove SDL merge method. It was very slow and unused.
Diffstat (limited to 'src/opengl1graphics.cpp')
-rw-r--r--src/opengl1graphics.cpp17
1 files changed, 9 insertions, 8 deletions
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 <SDL.h>
@@ -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<float>(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<float>(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;
}
}