From ad02b24b25f565a274ff8ec8408acefc1c232e12 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Dec 2012 21:06:21 +0300 Subject: Remove unused drawing class. --- src/normalopenglgraphics.cpp | 158 ------------------------------------------- 1 file changed, 158 deletions(-) (limited to 'src/normalopenglgraphics.cpp') diff --git a/src/normalopenglgraphics.cpp b/src/normalopenglgraphics.cpp index d41229442..00db5c647 100644 --- a/src/normalopenglgraphics.cpp +++ b/src/normalopenglgraphics.cpp @@ -620,23 +620,6 @@ void NormalOpenGLGraphics::drawRescaledImagePattern(const Image *const image, } } -void NormalOpenGLGraphics::drawImagePattern2(const GraphicsVertexes - *const vert, - const Image *const image) -{ - if (!image) - return; - - setColorAlpha(image->mAlpha); -#ifdef DEBUG_BIND_TEXTURE - debugBindTexture(image); -#endif - bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); - - drawVertexes(vert->getOGLconst()); -} - inline void NormalOpenGLGraphics::drawVertexes(const NormalOpenGLGraphicsVertexes &ogl) @@ -682,147 +665,6 @@ inline void NormalOpenGLGraphics::drawVertexes(const } } -void NormalOpenGLGraphics::calcImagePattern(GraphicsVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const -{ - if (!image) - { - vert->incPtr(1); - return; - } - - const int srcX = image->mBounds.x; - const int srcY = image->mBounds.y; - - const int iw = image->mBounds.w; - const int ih = image->mBounds.h; - - if (iw == 0 || ih == 0) - { - vert->incPtr(1); - return; - } - - const float tw = static_cast(image->mTexWidth); - const float th = static_cast(image->mTexHeight); - - unsigned int vp = 0; - const unsigned int vLimit = mMaxVertices * 4; - - NormalOpenGLGraphicsVertexes &ogl = vert->getOGL(); - ogl.init(); - - // Draw a set of textured rectangles - if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) - { - float texX1 = static_cast(srcX) / tw; - float texY1 = static_cast(srcY) / th; - - GLfloat *floatTexArray = ogl.switchFloatTexArray(); - GLint *intVertArray = ogl.switchIntVertArray(); - - for (int py = 0; py < h; py += ih) - { - const int height = (py + ih >= h) ? h - py : ih; - const int dstY = y + py; - for (int px = 0; px < w; px += iw) - { - int width = (px + iw >= w) ? w - px : iw; - int dstX = x + px; - - float texX2 = static_cast(srcX + width) / tw; - float texY2 = static_cast(srcY + height) / th; - - floatTexArray[vp + 0] = texX1; - floatTexArray[vp + 1] = texY1; - - floatTexArray[vp + 2] = texX2; - floatTexArray[vp + 3] = texY1; - - floatTexArray[vp + 4] = texX2; - floatTexArray[vp + 5] = texY2; - - floatTexArray[vp + 6] = texX1; - floatTexArray[vp + 7] = texY2; - - intVertArray[vp + 0] = dstX; - intVertArray[vp + 1] = dstY; - - intVertArray[vp + 2] = dstX + width; - intVertArray[vp + 3] = dstY; - - intVertArray[vp + 4] = dstX + width; - intVertArray[vp + 5] = dstY + height; - - intVertArray[vp + 6] = dstX; - intVertArray[vp + 7] = dstY + height; - - vp += 8; - if (vp >= vLimit) - { - floatTexArray = ogl.switchFloatTexArray(); - intVertArray = ogl.switchIntVertArray(); - ogl.switchVp(vp); - vp = 0; - } - } - } - } - else - { - GLint *intTexArray = ogl.switchIntTexArray(); - GLint *intVertArray = ogl.switchIntVertArray(); - - for (int py = 0; py < h; py += ih) - { - const int height = (py + ih >= h) ? h - py : ih; - const int dstY = y + py; - for (int px = 0; px < w; px += iw) - { - int width = (px + iw >= w) ? w - px : iw; - int dstX = x + px; - - intTexArray[vp + 0] = srcX; - intTexArray[vp + 1] = srcY; - - intTexArray[vp + 2] = srcX + width; - intTexArray[vp + 3] = srcY; - - intTexArray[vp + 4] = srcX + width; - intTexArray[vp + 5] = srcY + height; - - intTexArray[vp + 6] = srcX; - intTexArray[vp + 7] = srcY + height; - - intVertArray[vp + 0] = dstX; - intVertArray[vp + 1] = dstY; - - intVertArray[vp + 2] = dstX + width; - intVertArray[vp + 3] = dstY; - - intVertArray[vp + 4] = dstX + width; - intVertArray[vp + 5] = dstY + height; - - intVertArray[vp + 6] = dstX; - intVertArray[vp + 7] = dstY + height; - - vp += 8; - if (vp >= vLimit) - { - intTexArray = ogl.switchIntTexArray(); - intVertArray = ogl.switchIntVertArray(); - ogl.switchVp(vp); - vp = 0; - } - } - } - } - ogl.switchVp(vp); - vert->incPtr(1); -} - void NormalOpenGLGraphics::calcImagePattern(ImageVertexes* const vert, const Image *const image, const int x, const int y, -- cgit v1.2.3-60-g2f50