diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-06 21:06:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-06 21:06:21 +0300 |
commit | ad02b24b25f565a274ff8ec8408acefc1c232e12 (patch) | |
tree | b6e1e935fdfab13cae4451a12c59b014a1d8c4a6 /src/normalopenglgraphics.cpp | |
parent | 6cd4c1a2b02726766ad0d5317013ba2e1314c127 (diff) | |
download | mv-ad02b24b25f565a274ff8ec8408acefc1c232e12.tar.gz mv-ad02b24b25f565a274ff8ec8408acefc1c232e12.tar.bz2 mv-ad02b24b25f565a274ff8ec8408acefc1c232e12.tar.xz mv-ad02b24b25f565a274ff8ec8408acefc1c232e12.zip |
Remove unused drawing class.
Diffstat (limited to 'src/normalopenglgraphics.cpp')
-rw-r--r-- | src/normalopenglgraphics.cpp | 158 |
1 files changed, 0 insertions, 158 deletions
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<float>(image->mTexWidth); - const float th = static_cast<float>(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<float>(srcX) / tw; - float texY1 = static_cast<float>(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<float>(srcX + width) / tw; - float texY2 = static_cast<float>(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, |