diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/graphics.cpp | 189 | ||||
-rw-r--r-- | src/graphics.h | 29 | ||||
-rw-r--r-- | src/graphicsmanager.cpp | 2 | ||||
-rw-r--r-- | src/graphicsvertexes.cpp | 62 | ||||
-rw-r--r-- | src/graphicsvertexes.h | 69 | ||||
-rw-r--r-- | src/mobileopenglgraphics.cpp | 122 | ||||
-rw-r--r-- | src/mobileopenglgraphics.h | 8 | ||||
-rw-r--r-- | src/normalopenglgraphics.cpp | 158 | ||||
-rw-r--r-- | src/normalopenglgraphics.h | 8 | ||||
-rw-r--r-- | src/safeopenglgraphics.cpp | 32 | ||||
-rw-r--r-- | src/safeopenglgraphics.h | 16 |
11 files changed, 6 insertions, 689 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 507f16a6e..d22975db9 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -612,132 +612,6 @@ void Graphics::drawImageRect(int x, int y, int w, int h, imgRect.grid[4]); } -void Graphics::drawImageRect2(GraphicsVertexes *const vert, - const ImageRect &imgRect) -{ - if (!vert) - return; - - vert->setPtr(0); - - const bool drawMain = imgRect.grid[4] && imgRect.grid[0] && imgRect.grid[2] - && imgRect.grid[6] && imgRect.grid[8]; - - if (drawMain) - { - // center - drawImagePattern2(vert, imgRect.grid[4]); - } - vert->incPtr(); - - // top - drawImagePattern2(vert, imgRect.grid[1]); - vert->incPtr(); - - // bottom - drawImagePattern2(vert, imgRect.grid[7]); - vert->incPtr(); - - // left - drawImagePattern2(vert, imgRect.grid[3]); - vert->incPtr(); - - // right - drawImagePattern2(vert, imgRect.grid[5]); - vert->incPtr(); - - // Draw the corners - if (drawMain) - { - drawImage(imgRect.grid[0], 0, 0); - drawImage(imgRect.grid[2], vert->mW - imgRect.grid[2]->getWidth(), 0); - drawImage(imgRect.grid[6], 0, vert->mH - imgRect.grid[6]->getHeight()); - drawImage(imgRect.grid[8], - vert->mW - imgRect.grid[8]->getWidth(), - vert->mH - imgRect.grid[8]->getHeight()); - } -} - -void Graphics::drawImagePattern2(const GraphicsVertexes *const vert, - const Image *const img) -{ - // here not checking input parameters - - const std::vector<DoubleRect*> *const arr = vert->getRectsSDLconst(); - - for (std::vector<DoubleRect*>::const_iterator it = arr->begin(), - it_end = arr->end(); it != it_end; ++it) - { - SDL_LowerBlit(img->mSDLSurface, &(*it)->src, mTarget, &(*it)->dst); -// SDL_BlitSurface(img->mSDLSurface, &(*it)->src, mTarget, &(*it)->dst); - } -} - -bool Graphics::calcImageRect(GraphicsVertexes *const vert, - const int x, const int y, - const int w, const int h, - const Image *const topLeft, - const Image *const topRight, - const Image *const bottomLeft, - const Image *const bottomRight, - const Image *const top, - const Image *const right, - const Image *const bottom, - const Image *const left, - const Image *const center) -{ - if (!vert) - return false; - - BLOCK_START("Graphics::calcImageRect") - const bool drawMain = center && topLeft && topRight - && bottomLeft && bottomRight; - - vert->init(x, y, w, h); - pushClipArea(gcn::Rectangle(vert->mX, vert->mY, vert->mW, vert->mH)); - - // Draw the center area - if (center && drawMain) - { - calcImagePattern(vert, center, - topLeft->getWidth(), topLeft->getHeight(), - w - topLeft->getWidth() - topRight->getWidth(), - h - topLeft->getHeight() - bottomLeft->getHeight()); - } - else - { - vert->incPtr(1); - } - - // Draw the sides - if (top && left && bottom && right) - { - calcImagePattern(vert, top, - left->getWidth(), 0, - w - left->getWidth() - right->getWidth(), top->getHeight()); - calcImagePattern(vert, bottom, - left->getWidth(), h - bottom->getHeight(), - w - left->getWidth() - right->getWidth(), - bottom->getHeight()); - calcImagePattern(vert, left, - 0, top->getHeight(), - left->getWidth(), - h - top->getHeight() - bottom->getHeight()); - calcImagePattern(vert, right, - w - right->getWidth(), top->getHeight(), - right->getWidth(), - h - top->getHeight() - bottom->getHeight()); - } - else - { - vert->incPtr(4); - } - - popClipArea(); - BLOCK_END("Graphics::calcImageRect") - return 0; -} - bool Graphics::calcImageRect(ImageVertexes *const vert, const int x, const int y, const int w, const int h, @@ -799,59 +673,6 @@ bool Graphics::calcImageRect(ImageVertexes *const vert, return 0; } -void Graphics::calcImagePattern(GraphicsVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const -{ - // Check that preconditions for blitting are met. - if (!vert || !mTarget || !image || !image->mSDLSurface || !vert->sdl) - { - vert->incPtr(1); - return; - } - vert->clearSDL(); - - const int iw = image->mBounds.w; - const int ih = image->mBounds.h; - - if (iw == 0 || ih == 0) - { - vert->incPtr(1); - return; - } - - for (int py = 0; py < h; py += ih) // Y position on pattern plane - { - const int dh = (py + ih >= h) ? h - py : ih; - const int srcY = image->mBounds.y; - const int dstY = y + py + mClipStack.top().yOffset; - - for (int px = 0; px < w; px += iw) // X position on pattern plane - { - const int dw = (px + iw >= w) ? w - px : iw; - const int srcX = image->mBounds.x; - const int dstX = x + px + mClipStack.top().xOffset; - - SDL_Rect dstRect; - SDL_Rect srcRect; - dstRect.x = static_cast<short>(dstX); - dstRect.y = static_cast<short>(dstY); - srcRect.x = static_cast<short>(srcX); - srcRect.y = static_cast<short>(srcY); - srcRect.w = static_cast<uint16_t>(dw); - srcRect.h = static_cast<uint16_t>(dh); - - if (SDL_FakeUpperBlit(image->mSDLSurface, &srcRect, - mTarget, &dstRect) == 1) - { - vert->pushSDL(srcRect, dstRect); - } - } - } - vert->incPtr(1); -} - void Graphics::calcImagePattern(ImageVertexes* const vert, const Image *const image, const int x, const int y, @@ -1060,16 +881,6 @@ bool Graphics::drawNet(const int x1, const int y1, const int x2, const int y2, return true; } -bool Graphics::calcWindow(GraphicsVertexes *const vert, - const int x, const int y, const int w, const int h, - const ImageRect &imgRect) -{ - return calcImageRect(vert, x, y, w, h, - imgRect.grid[0], imgRect.grid[2], imgRect.grid[6], imgRect.grid[8], - imgRect.grid[1], imgRect.grid[5], imgRect.grid[7], imgRect.grid[3], - imgRect.grid[4]); -} - bool Graphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) diff --git a/src/graphics.h b/src/graphics.h index 141de7456..84a4a8418 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -27,7 +27,6 @@ #include "localconsts.h" -class GraphicsVertexes; class Image; class ImageCollection; class ImageVertexes; @@ -199,19 +198,6 @@ class Graphics : public gcn::SDLGraphics void drawImageRect(int x, int y, int w, int h, const ImageRect &imgRect); - virtual bool calcImageRect(GraphicsVertexes *const vert, - const int x, const int y, - const int w, const int h, - const Image *const topLeft, - const Image *const topRight, - const Image *const bottomLeft, - const Image *const bottomRight, - const Image *const top, - const Image *const right, - const Image *const bottom, - const Image *const left, - const Image *const center); - virtual bool calcImageRect(ImageVertexes *const vert, const int x, const int y, const int w, const int h, @@ -225,11 +211,6 @@ class Graphics : public gcn::SDLGraphics const Image *const left, const Image *const center); - virtual void calcImagePattern(GraphicsVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const; - virtual void calcImagePattern(ImageVertexes *const vert, const Image *const image, const int x, const int y, @@ -253,16 +234,6 @@ class Graphics : public gcn::SDLGraphics const Image *const image, int x, int y); - virtual void drawImageRect2(GraphicsVertexes *const vert, - const ImageRect &imgRect); - - virtual void drawImagePattern2(const GraphicsVertexes *const vert, - const Image *const img); - - bool calcWindow(GraphicsVertexes *const vert, - const int x, const int y, const int w, const int h, - const ImageRect &imgRect); - virtual bool calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index e5fcdcf5c..cb7c401c6 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -197,7 +197,7 @@ void GraphicsManager::initGraphics(bool noOpenGL) // Setup image loading for the right image format OpenGLImageHelper::setLoadAsOpenGL(useOpenGL); - GraphicsVertexes::setLoadAsOpenGL(useOpenGL); +// GraphicsVertexes::setLoadAsOpenGL(useOpenGL); // Create the graphics context switch (useOpenGL) diff --git a/src/graphicsvertexes.cpp b/src/graphicsvertexes.cpp index 3ad522d79..2f4a42bee 100644 --- a/src/graphicsvertexes.cpp +++ b/src/graphicsvertexes.cpp @@ -26,7 +26,7 @@ #ifdef USE_OPENGL unsigned int vertexBufSize = 500; -int GraphicsVertexes::mUseOpenGL = 0; +//int GraphicsVertexes::mUseOpenGL = 0; #endif SDLGraphicsVertexes::SDLGraphicsVertexes() @@ -216,64 +216,12 @@ GLint *NormalOpenGLGraphicsVertexes::continueIntTexArray() } #endif -GraphicsVertexes::GraphicsVertexes() : - mX(0), mY(0), - mW(0), mH(0), - mPtr(0) -{ -} - -GraphicsVertexes::~GraphicsVertexes() -{ -} - -void GraphicsVertexes::init(const int x, const int y, const int w, const int h) -{ - mPtr = 0; - mX = x; - mY = y; - mW = w; - mH = h; - for (int f = 0; f < 10; f ++) - { - delete_all(sdl[mPtr].mList); - sdl[mPtr].mList.clear(); #ifdef USE_OPENGL - ogl[mPtr].init(); +//void GraphicsVertexes::setLoadAsOpenGL(int useOpenGL) +//{ +// mUseOpenGL = useOpenGL; +//} #endif - } -} - -#ifdef USE_OPENGL -void GraphicsVertexes::setLoadAsOpenGL(int useOpenGL) -{ - mUseOpenGL = useOpenGL; -} -#endif - -void GraphicsVertexes::pushSDL(const SDL_Rect &r1, const SDL_Rect &r2) -{ - DoubleRect *const r = new DoubleRect(); - r->src = r1; - r->dst = r2; - sdl[mPtr].mList.push_back(r); -} - -void GraphicsVertexes::clearSDL() -{ - delete_all(sdl[mPtr].mList); - sdl[mPtr].mList.clear(); -} - -std::vector<DoubleRect*> *GraphicsVertexes::getRectsSDL() -{ - return &sdl[mPtr].mList; -} - -const std::vector<DoubleRect*> *GraphicsVertexes::getRectsSDLconst() const -{ - return &sdl[mPtr].mList; -} ImageVertexes::ImageVertexes() : image(nullptr) diff --git a/src/graphicsvertexes.h b/src/graphicsvertexes.h index 8a8c1133e..b5bb19749 100644 --- a/src/graphicsvertexes.h +++ b/src/graphicsvertexes.h @@ -21,7 +21,6 @@ #ifndef GRAPHICSVERTEXES_H #define GRAPHICSVERTEXES_H - #include "main.h" #include "localconsts.h" @@ -67,10 +66,6 @@ class SDLGraphicsVertexes final }; #ifdef USE_OPENGL -class SafeOpenGLGraphicsVertexes final -{ -}; - class NormalOpenGLGraphicsVertexes final { public: @@ -176,70 +171,6 @@ class ImageCollection final ImageVertexesVector draws; }; -class GraphicsVertexes final -{ - public: - GraphicsVertexes(); - - A_DELETE_COPY(GraphicsVertexes) - - ~GraphicsVertexes(); - - static void setLoadAsOpenGL(int useOpenGL); - - SDLGraphicsVertexes sdl[5]; - -#ifdef USE_OPENGL -// SafeOpenGLGraphicsVertexes ogl1[5]; - - NormalOpenGLGraphicsVertexes ogl[5]; -#endif - - void init(const int x, const int y, const int w, const int h); - - void pushSDL(const SDL_Rect &r1, const SDL_Rect &r2); - - void clearSDL(); - - std::vector<DoubleRect*> *getRectsSDL(); - - const std::vector<DoubleRect*> *getRectsSDLconst() const; - - void incPtr(const int num = 1) - { mPtr += num; } - - void setPtr(const int num) - { mPtr = num; } - -#ifdef USE_OPENGL - NormalOpenGLGraphicsVertexes &getOGL() A_WARN_UNUSED - { return ogl[mPtr]; } - - const NormalOpenGLGraphicsVertexes &getOGLconst() const A_WARN_UNUSED - { return ogl[mPtr]; } -#endif - - int getX() const A_WARN_UNUSED - { return mX; } - - int getY() const A_WARN_UNUSED - { return mY; } - - int getW() const A_WARN_UNUSED - { return mW; } - - int getH() const A_WARN_UNUSED - { return mH; } - - int mX, mY, mW, mH; - int mPtr; - - private: -#ifdef USE_OPENGL - static int mUseOpenGL; -#endif -}; - #ifdef USE_OPENGL extern unsigned int vertexBufSize; #endif diff --git a/src/mobileopenglgraphics.cpp b/src/mobileopenglgraphics.cpp index 92afbc741..cbd1a8720 100644 --- a/src/mobileopenglgraphics.cpp +++ b/src/mobileopenglgraphics.cpp @@ -502,23 +502,6 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, // } } -void MobileOpenGLGraphics::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 MobileOpenGLGraphics::drawVertexes(const NormalOpenGLGraphicsVertexes &ogl) @@ -549,111 +532,6 @@ inline void MobileOpenGLGraphics::drawVertexes(const } } -void MobileOpenGLGraphics::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(); - GLshort *shortVertArray = ogl.switchShortVertArray(); - - 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] = texY1; - - floatTexArray[vp + 8] = texX1; - floatTexArray[vp + 9] = texY2; - - floatTexArray[vp + 10] = texX2; - floatTexArray[vp + 11] = texY2; - - - shortVertArray[vp + 0] = dstX; - shortVertArray[vp + 1] = dstY; - - shortVertArray[vp + 2] = dstX + width; - shortVertArray[vp + 3] = dstY; - - shortVertArray[vp + 4] = dstX + width; - shortVertArray[vp + 5] = dstY + height; - - shortVertArray[vp + 6] = dstX; - shortVertArray[vp + 7] = dstY; - - shortVertArray[vp + 8] = dstX; - shortVertArray[vp + 9] = dstY + height; - - shortVertArray[vp + 10] = dstX + width; - shortVertArray[vp + 11] = dstY + height; - - vp += 12; - if (vp >= vLimit) - { - floatTexArray = ogl.switchFloatTexArray(); - shortVertArray = ogl.switchShortVertArray(); - ogl.switchVp(vp); - vp = 0; - } - } - } - } - ogl.switchVp(vp); - vert->incPtr(1); -} - void MobileOpenGLGraphics::calcImagePattern(ImageVertexes *const vert, const Image *const image, const int x, const int y, diff --git a/src/mobileopenglgraphics.h b/src/mobileopenglgraphics.h index ad630c6b7..ba03aee99 100644 --- a/src/mobileopenglgraphics.h +++ b/src/mobileopenglgraphics.h @@ -90,11 +90,6 @@ class MobileOpenGLGraphics final : public Graphics const int scaledWidth, const int scaledHeight) override; - void calcImagePattern(GraphicsVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override; - void calcImagePattern(ImageVertexes *const vert, const Image *const image, const int x, const int y, @@ -115,9 +110,6 @@ class MobileOpenGLGraphics final : public Graphics void drawTile(const ImageVertexes *const vert) override; - void drawImagePattern2(const GraphicsVertexes *const vert, - const Image *const image) override; - bool calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, 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, diff --git a/src/normalopenglgraphics.h b/src/normalopenglgraphics.h index 2c70a0fbe..874e68fad 100644 --- a/src/normalopenglgraphics.h +++ b/src/normalopenglgraphics.h @@ -90,11 +90,6 @@ class NormalOpenGLGraphics final : public Graphics const int scaledWidth, const int scaledHeight) override; - void calcImagePattern(GraphicsVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override; - void calcImagePattern(ImageVertexes* const vert, const Image *const image, const int x, const int y, @@ -115,9 +110,6 @@ class NormalOpenGLGraphics final : public Graphics void drawTile(const ImageVertexes *const vert) override; - void drawImagePattern2(const GraphicsVertexes *const vert, - const Image *const image) override; - bool calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, diff --git a/src/safeopenglgraphics.cpp b/src/safeopenglgraphics.cpp index 6b6c80116..076edbfbb 100644 --- a/src/safeopenglgraphics.cpp +++ b/src/safeopenglgraphics.cpp @@ -333,26 +333,6 @@ void SafeOpenGLGraphics::drawRescaledImagePattern(const Image *const image, glEnd(); } -bool SafeOpenGLGraphics::calcImageRect(GraphicsVertexes *const vert, - const int x, const int y, - const int w, const int h, - const Image *const topLeft A_UNUSED, - const Image *const topRight A_UNUSED, - const Image *const bottomLeft A_UNUSED, - const Image *const bottomRight A_UNUSED, - const Image *const top A_UNUSED, - const Image *const right A_UNUSED, - const Image *const bottom A_UNUSED, - const Image *const left A_UNUSED, - const Image *const center A_UNUSED) -{ - if (!vert) - return false; - - vert->init(x, y, w, h); - return true; -} - void SafeOpenGLGraphics::calcTile(ImageCollection *const vertCol A_UNUSED, const Image *const image A_UNUSED, int x A_UNUSED, int y A_UNUSED) @@ -370,18 +350,6 @@ void SafeOpenGLGraphics::drawTile(const ImageVertexes *const vert A_UNUSED) } -void SafeOpenGLGraphics::drawImageRect2(GraphicsVertexes* vert, - const ImageRect &imgRect) -{ - if (!vert) - return; - - drawImageRect(vert->getX(), vert->getY(), vert->getW(), vert->getH(), - imgRect.grid[0], imgRect.grid[2], imgRect.grid[6], imgRect.grid[8], - imgRect.grid[1], imgRect.grid[5], imgRect.grid[7], imgRect.grid[3], - imgRect.grid[4]); -} - void SafeOpenGLGraphics::updateScreen() { BLOCK_START("Graphics::updateScreen") diff --git a/src/safeopenglgraphics.h b/src/safeopenglgraphics.h index cd79f213f..9be2ba943 100644 --- a/src/safeopenglgraphics.h +++ b/src/safeopenglgraphics.h @@ -83,22 +83,6 @@ class SafeOpenGLGraphics final : public Graphics const int scaledWidth, const int scaledHeight) override; - bool calcImageRect(GraphicsVertexes *const vert, - const int x, const int y, - const int w, const int h, - const Image *const topLeft, - const Image *const topRight, - const Image *const bottomLeft, - const Image *const bottomRight, - const Image *const top, - const Image *const right, - const Image *const bottom, - const Image *const left, - const Image *const center) override; - - void drawImageRect2(GraphicsVertexes *const vert, - const ImageRect &imgRect) override; - void calcTile(ImageVertexes *const vert, const Image *const image, int x, int y) const override; |