diff options
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/commandhandler.cpp | 4 | ||||
-rw-r--r-- | src/compoundsprite.cpp | 2 | ||||
-rw-r--r-- | src/graphicsmanager.cpp | 2 | ||||
-rw-r--r-- | src/graphicsvertexes.cpp | 26 | ||||
-rw-r--r-- | src/graphicsvertexes.h | 14 | ||||
-rw-r--r-- | src/normalopenglgraphics.cpp (renamed from src/openglgraphics.cpp) | 137 | ||||
-rw-r--r-- | src/normalopenglgraphics.h (renamed from src/openglgraphics.h) | 6 | ||||
-rw-r--r-- | src/resources/image.cpp | 2 | ||||
-rw-r--r-- | src/resources/image.h | 2 | ||||
-rw-r--r-- | src/resources/openglimagehelper.cpp | 4 | ||||
-rw-r--r-- | src/resources/subimage.cpp | 2 | ||||
-rw-r--r-- | src/safeopenglgraphics.cpp | 53 |
14 files changed, 135 insertions, 127 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 94d39ed4a..26a571c54 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -586,8 +586,8 @@ SET(SRCS map.h maplayer.cpp maplayer.h - openglgraphics.cpp - openglgraphics.h + normalopenglgraphics.cpp + normalopenglgraphics.h particle.cpp particle.h particlecontainer.cpp diff --git a/src/Makefile.am b/src/Makefile.am index b69cce69b..2eac1be38 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -599,8 +599,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ map.h \ maplayer.cpp \ maplayer.h \ - openglgraphics.cpp\ - openglgraphics.h \ + normalopenglgraphics.cpp\ + normalopenglgraphics.h \ particle.cpp \ particle.h \ particlecontainer.cpp \ diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 75f4a5331..af87adafd 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -58,7 +58,7 @@ #include "net/tradehandler.h" #if defined USE_OPENGL -#include "openglgraphics.h" +#include "normalopenglgraphics.h" #endif #ifdef DEBUG_DUMP_LEAKS1 @@ -1367,6 +1367,6 @@ void CommandHandler::handleDumpOGL(const std::string &args A_UNUSED, ChatTab *tab A_UNUSED) { #if defined USE_OPENGL - OpenGLGraphics::dumpSettings(); + NormalOpenGLGraphics::dumpSettings(); #endif } diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index f3ccac072..91c8b16bc 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -26,7 +26,7 @@ #include "graphics.h" #ifdef USE_OPENGL -#include "openglgraphics.h" +#include "normalopenglgraphics.h" #include "safeopenglgraphics.h" #endif diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index f18f8c03d..cb5b2698b 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -168,7 +168,7 @@ void GraphicsManager::initGraphics(bool noOpenGL) case 1: default: imageHelper = new OpenGLImageHelper; - mainGraphics = new OpenGLGraphics; + mainGraphics = new NormalOpenGLGraphics; break; case 2: imageHelper = new OpenGLImageHelper; diff --git a/src/graphicsvertexes.cpp b/src/graphicsvertexes.cpp index a74d6558b..d09bc2d91 100644 --- a/src/graphicsvertexes.cpp +++ b/src/graphicsvertexes.cpp @@ -42,7 +42,7 @@ SDLGraphicsVertexes::~SDLGraphicsVertexes() } #ifdef USE_OPENGL -OpenGLGraphicsVertexes::OpenGLGraphicsVertexes() : +NormalOpenGLGraphicsVertexes::NormalOpenGLGraphicsVertexes() : ptr(0), mFloatTexArray(nullptr), mIntTexArray(nullptr), @@ -54,12 +54,12 @@ OpenGLGraphicsVertexes::OpenGLGraphicsVertexes() : mVp.reserve(30); } -OpenGLGraphicsVertexes::~OpenGLGraphicsVertexes() +NormalOpenGLGraphicsVertexes::~NormalOpenGLGraphicsVertexes() { clear(); } -void OpenGLGraphicsVertexes::clear() +void NormalOpenGLGraphicsVertexes::clear() { for (std::vector<GLfloat*>::iterator it = mFloatTexPool.begin(); it != mFloatTexPool.end(); ++ it) @@ -92,38 +92,38 @@ void OpenGLGraphicsVertexes::clear() } } -void OpenGLGraphicsVertexes::init() +void NormalOpenGLGraphicsVertexes::init() { clear(); } -GLfloat *OpenGLGraphicsVertexes::switchFloatTexArray() +GLfloat *NormalOpenGLGraphicsVertexes::switchFloatTexArray() { mFloatTexArray = new GLfloat[vertexBufSize * 4 + 30]; mFloatTexPool.push_back(mFloatTexArray); return mFloatTexArray; } -GLint *OpenGLGraphicsVertexes::switchIntVertArray() +GLint *NormalOpenGLGraphicsVertexes::switchIntVertArray() { mIntVertArray = new GLint[vertexBufSize * 4 + 30]; mIntVertPool.push_back(mIntVertArray); return mIntVertArray; } -GLint *OpenGLGraphicsVertexes::switchIntTexArray() +GLint *NormalOpenGLGraphicsVertexes::switchIntTexArray() { mIntTexArray = new GLint[vertexBufSize * 4 + 30]; mIntTexPool.push_back(mIntTexArray); return mIntTexArray; } -void OpenGLGraphicsVertexes::switchVp(int n) +void NormalOpenGLGraphicsVertexes::switchVp(int n) { mVp.push_back(n); } -int OpenGLGraphicsVertexes::continueVp() +int NormalOpenGLGraphicsVertexes::continueVp() { if (mVp.empty()) { @@ -137,7 +137,7 @@ int OpenGLGraphicsVertexes::continueVp() } } -GLfloat *OpenGLGraphicsVertexes::continueFloatTexArray() +GLfloat *NormalOpenGLGraphicsVertexes::continueFloatTexArray() { if (mFloatTexPool.empty()) { @@ -151,7 +151,7 @@ GLfloat *OpenGLGraphicsVertexes::continueFloatTexArray() return mFloatTexArray; } -GLint *OpenGLGraphicsVertexes::continueIntVertArray() +GLint *NormalOpenGLGraphicsVertexes::continueIntVertArray() { if (mIntVertPool.empty()) { @@ -165,7 +165,7 @@ GLint *OpenGLGraphicsVertexes::continueIntVertArray() return mIntVertArray; } -GLint *OpenGLGraphicsVertexes::continueIntTexArray() +GLint *NormalOpenGLGraphicsVertexes::continueIntTexArray() { if (mIntTexPool.empty()) { @@ -239,7 +239,7 @@ ImageVertexes::ImageVertexes() : { sdl.reserve(30); #ifdef USE_OPENGL - ogl = new OpenGLGraphicsVertexes(); + ogl = new NormalOpenGLGraphicsVertexes(); #endif } diff --git a/src/graphicsvertexes.h b/src/graphicsvertexes.h index 70ba4847b..b44f69179 100644 --- a/src/graphicsvertexes.h +++ b/src/graphicsvertexes.h @@ -34,7 +34,7 @@ #include <SDL_opengl.h> #include "safeopenglgraphics.h" -#include "openglgraphics.h" +#include "normalopenglgraphics.h" #endif #include <string> @@ -65,12 +65,12 @@ class SafeOpenGLGraphicsVertexes { }; -class OpenGLGraphicsVertexes +class NormalOpenGLGraphicsVertexes { public: - OpenGLGraphicsVertexes(); + NormalOpenGLGraphicsVertexes(); - ~OpenGLGraphicsVertexes(); + ~NormalOpenGLGraphicsVertexes(); GLfloat *switchFloatTexArray(); @@ -131,7 +131,7 @@ class ImageVertexes DoubleRects sdl; #ifdef USE_OPENGL - OpenGLGraphicsVertexes *ogl; + NormalOpenGLGraphicsVertexes *ogl; #endif }; @@ -149,7 +149,7 @@ class GraphicsVertexes #ifdef USE_OPENGL // SafeOpenGLGraphicsVertexes ogl1[5]; - OpenGLGraphicsVertexes ogl[5]; + NormalOpenGLGraphicsVertexes ogl[5]; #endif void init(int x, int y, int w, int h); @@ -167,7 +167,7 @@ class GraphicsVertexes { mPtr = num; } #ifdef USE_OPENGL - OpenGLGraphicsVertexes* getOGL() + NormalOpenGLGraphicsVertexes* getOGL() { return &ogl[mPtr]; } #endif diff --git a/src/openglgraphics.cpp b/src/normalopenglgraphics.cpp index 4edcb089d..1114f1620 100644 --- a/src/openglgraphics.cpp +++ b/src/normalopenglgraphics.cpp @@ -25,7 +25,7 @@ #ifdef USE_OPENGL #include "graphicsvertexes.h" -#include "openglgraphics.h" +#include "normalopenglgraphics.h" #include "configuration.h" #include "logger.h" @@ -45,9 +45,9 @@ const unsigned int vertexBufSize = 500; -GLuint OpenGLGraphics::mLastImage = 0; +GLuint NormalOpenGLGraphics::mLastImage = 0; -OpenGLGraphics::OpenGLGraphics(): +NormalOpenGLGraphics::NormalOpenGLGraphics(): mFloatTexArray(new GLfloat[vertexBufSize * 4 + 30]), mIntTexArray(new GLint[vertexBufSize * 4 + 30]), mIntVertArray(new GLint[vertexBufSize * 4 + 30]), @@ -67,15 +67,16 @@ OpenGLGraphics::OpenGLGraphics(): mName = "fast OpenGL"; } -OpenGLGraphics::~OpenGLGraphics() +NormalOpenGLGraphics::~NormalOpenGLGraphics() { delete [] mFloatTexArray; delete [] mIntTexArray; delete [] mIntVertArray; } -bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, - bool hwaccel, bool resize, bool noFrame) +bool NormalOpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, + bool hwaccel, bool resize, + bool noFrame) { setMainFlags(w, h, bpp, fs, hwaccel, resize, noFrame); @@ -206,9 +207,9 @@ static inline void drawRescaledQuad(Image *image, } -bool OpenGLGraphics::drawImage2(const Image *image, int srcX, int srcY, - int dstX, int dstY, - int width, int height, bool useColor) +bool NormalOpenGLGraphics::drawImage2(const Image *image, int srcX, int srcY, + int dstX, int dstY, + int width, int height, bool useColor) { if (!image) return false; @@ -239,11 +240,12 @@ bool OpenGLGraphics::drawImage2(const Image *image, int srcX, int srcY, return true; } -bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, - int dstX, int dstY, - int width, int height, - int desiredWidth, int desiredHeight, - bool useColor) +bool NormalOpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, + int dstX, int dstY, + int width, int height, + int desiredWidth, + int desiredHeight, + bool useColor) { return drawRescaledImage(image, srcX, srcY, dstX, dstY, @@ -252,11 +254,12 @@ bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, useColor, true); } -bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, - int dstX, int dstY, - int width, int height, - int desiredWidth, int desiredHeight, - bool useColor, bool smooth) +bool NormalOpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, + int dstX, int dstY, + int width, int height, + int desiredWidth, + int desiredHeight, + bool useColor, bool smooth) { if (!image) return false; @@ -315,8 +318,8 @@ bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, return true; } -void OpenGLGraphics::drawImagePattern(const Image *image, int x, int y, - int w, int h) +void NormalOpenGLGraphics::drawImagePattern(const Image *image, int x, int y, + int w, int h) { if (!image) return; @@ -450,11 +453,11 @@ void OpenGLGraphics::drawImagePattern(const Image *image, int x, int y, static_cast<GLubyte>(mColor.a)); } -void OpenGLGraphics::drawRescaledImagePattern(Image *image, - int x, int y, - int w, int h, - int scaledWidth, - int scaledHeight) +void NormalOpenGLGraphics::drawRescaledImagePattern(Image *image, + int x, int y, + int w, int h, + int scaledWidth, + int scaledHeight) { if (!image) return; @@ -606,13 +609,13 @@ void OpenGLGraphics::drawRescaledImagePattern(Image *image, static_cast<GLubyte>(mColor.a)); } -void OpenGLGraphics::drawImagePattern2(GraphicsVertexes *vert, - const Image *image) +void NormalOpenGLGraphics::drawImagePattern2(GraphicsVertexes *vert, + const Image *image) { if (!image) return; - OpenGLGraphicsVertexes *ogl = vert->getOGL(); + NormalOpenGLGraphicsVertexes *ogl = vert->getOGL(); glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha); #ifdef DEBUG_BIND_TEXTURE @@ -667,8 +670,9 @@ void OpenGLGraphics::drawImagePattern2(GraphicsVertexes *vert, } -void OpenGLGraphics::calcImagePattern(GraphicsVertexes* vert, Image *image, - int x, int y, int w, int h) +void NormalOpenGLGraphics::calcImagePattern(GraphicsVertexes* vert, + Image *image, + int x, int y, int w, int h) { if (!image) { @@ -694,7 +698,7 @@ void OpenGLGraphics::calcImagePattern(GraphicsVertexes* vert, Image *image, unsigned int vp = 0; const unsigned int vLimit = vertexBufSize * 4; - OpenGLGraphicsVertexes *ogl = vert->getOGL(); + NormalOpenGLGraphicsVertexes *ogl = vert->getOGL(); ogl->init(); // Draw a set of textured rectangles @@ -806,7 +810,7 @@ void OpenGLGraphics::calcImagePattern(GraphicsVertexes* vert, Image *image, vert->incPtr(1); } -void OpenGLGraphics::calcTile(ImageVertexes *vert, int dstX, int dstY) +void NormalOpenGLGraphics::calcTile(ImageVertexes *vert, int dstX, int dstY) { if (!vert) return; @@ -826,7 +830,7 @@ void OpenGLGraphics::calcTile(ImageVertexes *vert, int dstX, int dstY) const unsigned int vLimit = vertexBufSize * 4; - OpenGLGraphicsVertexes *ogl = vert->ogl; + NormalOpenGLGraphicsVertexes *ogl = vert->ogl; unsigned int vp = ogl->ptr; @@ -923,13 +927,13 @@ void OpenGLGraphics::calcTile(ImageVertexes *vert, int dstX, int dstY) ogl->ptr = vp; } -void OpenGLGraphics::drawTile(ImageVertexes *vert) +void NormalOpenGLGraphics::drawTile(ImageVertexes *vert) { if (!vert) return; Image *image = vert->image; - OpenGLGraphicsVertexes *ogl = vert->ogl; + NormalOpenGLGraphicsVertexes *ogl = vert->ogl; glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha); #ifdef DEBUG_BIND_TEXTURE @@ -949,7 +953,7 @@ void OpenGLGraphics::drawTile(ImageVertexes *vert) static_cast<GLubyte>(mColor.a)); } -void OpenGLGraphics::updateScreen() +void NormalOpenGLGraphics::updateScreen() { // glFlush(); // glFinish(); @@ -958,7 +962,7 @@ void OpenGLGraphics::updateScreen() // glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); } -void OpenGLGraphics::_beginDraw() +void NormalOpenGLGraphics::_beginDraw() { glMatrixMode(GL_TEXTURE); glLoadIdentity(); @@ -994,12 +998,12 @@ void OpenGLGraphics::_beginDraw() pushClipArea(gcn::Rectangle(0, 0, mTarget->w, mTarget->h)); } -void OpenGLGraphics::_endDraw() +void NormalOpenGLGraphics::_endDraw() { popClipArea(); } -void OpenGLGraphics::prepareScreenshot() +void NormalOpenGLGraphics::prepareScreenshot() { #if !defined(_WIN32) if (config.getBoolValue("usefbo")) @@ -1043,7 +1047,7 @@ void OpenGLGraphics::prepareScreenshot() #endif } -SDL_Surface* OpenGLGraphics::getScreenshot() +SDL_Surface* NormalOpenGLGraphics::getScreenshot() { const int h = mTarget->h; const int w = mTarget->w - (mTarget->w % 4); @@ -1114,7 +1118,7 @@ SDL_Surface* OpenGLGraphics::getScreenshot() return screenshot; } -bool OpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool NormalOpenGLGraphics::pushClipArea(gcn::Rectangle area) { int transX = 0; int transY = 0; @@ -1144,7 +1148,7 @@ bool OpenGLGraphics::pushClipArea(gcn::Rectangle area) return result; } -void OpenGLGraphics::popClipArea() +void NormalOpenGLGraphics::popClipArea() { gcn::Graphics::popClipArea(); @@ -1157,7 +1161,7 @@ void OpenGLGraphics::popClipArea() clipArea.width, clipArea.height); } -void OpenGLGraphics::setColor(const gcn::Color& color) +void NormalOpenGLGraphics::setColor(const gcn::Color& color) { mColor = color; glColor4ub(static_cast<GLubyte>(color.r), @@ -1168,7 +1172,7 @@ void OpenGLGraphics::setColor(const gcn::Color& color) mColorAlpha = (color.a != 255); } -void OpenGLGraphics::drawPoint(int x, int y) +void NormalOpenGLGraphics::drawPoint(int x, int y) { setTexturingAndBlending(false); @@ -1177,7 +1181,7 @@ void OpenGLGraphics::drawPoint(int x, int y) glEnd(); } -void OpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) +void NormalOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) { setTexturingAndBlending(false); glDisableClientState(GL_TEXTURE_COORD_ARRAY); @@ -1192,21 +1196,22 @@ void OpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) glEnableClientState(GL_TEXTURE_COORD_ARRAY); } -void OpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) { drawRectangle(rect, false); } -void OpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void NormalOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) { drawRectangle(rect, true); } -void OpenGLGraphics::setTargetPlane(int width A_UNUSED, int height A_UNUSED) +void NormalOpenGLGraphics::setTargetPlane(int width A_UNUSED, + int height A_UNUSED) { } -void OpenGLGraphics::setTexturingAndBlending(bool enable) +void NormalOpenGLGraphics::setTexturingAndBlending(bool enable) { if (enable) { @@ -1244,7 +1249,8 @@ void OpenGLGraphics::setTexturingAndBlending(bool enable) } } -void OpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, bool filled) +void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, + bool filled) { const float offset = filled ? 0 : 0.5f; const float x = static_cast<float>(rect.x); @@ -1269,8 +1275,8 @@ void OpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, bool filled) glEnableClientState(GL_TEXTURE_COORD_ARRAY); } -bool OpenGLGraphics::drawNet(int x1, int y1, int x2, int y2, - int width, int height) +bool NormalOpenGLGraphics::drawNet(int x1, int y1, int x2, int y2, + int width, int height) { unsigned int vp = 0; const unsigned int vLimit = vertexBufSize * 4; @@ -1322,7 +1328,7 @@ bool OpenGLGraphics::drawNet(int x1, int y1, int x2, int y2, return true; } -void OpenGLGraphics::bindTexture(GLenum target, GLuint texture) +void NormalOpenGLGraphics::bindTexture(GLenum target, GLuint texture) { if (mLastImage != texture) { @@ -1331,7 +1337,7 @@ void OpenGLGraphics::bindTexture(GLenum target, GLuint texture) } } -inline void OpenGLGraphics::drawQuadArrayfi(int size) +inline void NormalOpenGLGraphics::drawQuadArrayfi(int size) { glVertexPointer(2, GL_INT, 0, mIntVertArray); glTexCoordPointer(2, GL_FLOAT, 0, mFloatTexArray); @@ -1339,8 +1345,9 @@ inline void OpenGLGraphics::drawQuadArrayfi(int size) glDrawArrays(GL_QUADS, 0, size / 2); } -inline void OpenGLGraphics::drawQuadArrayfi(GLint *intVertArray, - GLfloat *floatTexArray, int size) +inline void NormalOpenGLGraphics::drawQuadArrayfi(GLint *intVertArray, + GLfloat *floatTexArray, + int size) { glVertexPointer(2, GL_INT, 0, intVertArray); glTexCoordPointer(2, GL_FLOAT, 0, floatTexArray); @@ -1348,7 +1355,7 @@ inline void OpenGLGraphics::drawQuadArrayfi(GLint *intVertArray, glDrawArrays(GL_QUADS, 0, size / 2); } -inline void OpenGLGraphics::drawQuadArrayii(int size) +inline void NormalOpenGLGraphics::drawQuadArrayii(int size) { glVertexPointer(2, GL_INT, 0, mIntVertArray); glTexCoordPointer(2, GL_INT, 0, mIntTexArray); @@ -1356,8 +1363,8 @@ inline void OpenGLGraphics::drawQuadArrayii(int size) glDrawArrays(GL_QUADS, 0, size / 2); } -inline void OpenGLGraphics::drawQuadArrayii(GLint *intVertArray, - GLint *intTexArray, int size) +inline void NormalOpenGLGraphics::drawQuadArrayii(GLint *intVertArray, + GLint *intTexArray, int size) { glVertexPointer(2, GL_INT, 0, intVertArray); glTexCoordPointer(2, GL_INT, 0, intTexArray); @@ -1365,21 +1372,21 @@ inline void OpenGLGraphics::drawQuadArrayii(GLint *intVertArray, glDrawArrays(GL_QUADS, 0, size / 2); } -inline void OpenGLGraphics::drawLineArrayi(int size) +inline void NormalOpenGLGraphics::drawLineArrayi(int size) { glVertexPointer(2, GL_INT, 0, mIntVertArray); glDrawArrays(GL_LINES, 0, size / 2); } -inline void OpenGLGraphics::drawLineArrayf(int size) +inline void NormalOpenGLGraphics::drawLineArrayf(int size) { glVertexPointer(2, GL_FLOAT, 0, mFloatTexArray); glDrawArrays(GL_LINES, 0, size / 2); } -void OpenGLGraphics::dumpSettings() +void NormalOpenGLGraphics::dumpSettings() { GLint test[1000]; logger->log("\n\n"); @@ -1400,7 +1407,7 @@ void OpenGLGraphics::dumpSettings() } #ifdef DEBUG_BIND_TEXTURE -void OpenGLGraphics::debugBindTexture(const Image *image) +void NormalOpenGLGraphics::debugBindTexture(const Image *image) { const std::string texture = image->getIdPath(); if (mOldTexture != texture) @@ -1416,7 +1423,7 @@ void OpenGLGraphics::debugBindTexture(const Image *image) } } #else -void OpenGLGraphics::debugBindTexture(const Image *image A_UNUSED) +void NormalOpenGLGraphics::debugBindTexture(const Image *image A_UNUSED) { } #endif diff --git a/src/openglgraphics.h b/src/normalopenglgraphics.h index f0d0078a1..5c86f40e4 100644 --- a/src/openglgraphics.h +++ b/src/normalopenglgraphics.h @@ -37,12 +37,12 @@ #include <set> -class OpenGLGraphics : public Graphics +class NormalOpenGLGraphics : public Graphics { public: - OpenGLGraphics(); + NormalOpenGLGraphics(); - ~OpenGLGraphics(); + ~NormalOpenGLGraphics(); bool setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel, bool resize, bool noFrame); diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 342bca1b5..4b5fa4f40 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -26,7 +26,7 @@ #include "resources/resourcemanager.h" #ifdef USE_OPENGL -#include "openglgraphics.h" +#include "normalopenglgraphics.h" #include "safeopenglgraphics.h" #endif diff --git a/src/resources/image.h b/src/resources/image.h index 756c9e23d..84895125c 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -59,7 +59,7 @@ class Image : public Resource friend class OpenGLImageHelper; friend class SDLImageHelper; #ifdef USE_OPENGL - friend class OpenGLGraphics; + friend class NormalOpenGLGraphics; friend class SafeOpenGLGraphics; #endif diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp index 120288b3f..841f9b3ae 100644 --- a/src/resources/openglimagehelper.cpp +++ b/src/resources/openglimagehelper.cpp @@ -27,7 +27,7 @@ #include "resources/dye.h" #include "resources/resourcemanager.h" -#include "openglgraphics.h" +#include "normalopenglgraphics.h" #include "safeopenglgraphics.h" #include "client.h" @@ -213,7 +213,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage) GLuint texture; glGenTextures(1, &texture); if (mUseOpenGL == 1) - OpenGLGraphics::bindTexture(mTextureType, texture); + NormalOpenGLGraphics::bindTexture(mTextureType, texture); else if (mUseOpenGL == 2) SafeOpenGLGraphics::bindTexture(mTextureType, texture); diff --git a/src/resources/subimage.cpp b/src/resources/subimage.cpp index 1b9f745d3..2f4104580 100644 --- a/src/resources/subimage.cpp +++ b/src/resources/subimage.cpp @@ -23,7 +23,7 @@ #include "resources/subimage.h" #ifdef USE_OPENGL -#include "openglgraphics.h" +#include "normalopenglgraphics.h" #include "safeopenglgraphics.h" #endif diff --git a/src/safeopenglgraphics.cpp b/src/safeopenglgraphics.cpp index cc8bcc95b..37001f850 100644 --- a/src/safeopenglgraphics.cpp +++ b/src/safeopenglgraphics.cpp @@ -56,7 +56,7 @@ SafeOpenGLGraphics::~SafeOpenGLGraphics() } bool SafeOpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, - bool hwaccel, bool resize, bool noFrame) + bool hwaccel, bool resize, bool noFrame) { setMainFlags(w, h, bpp, fs, hwaccel, resize, noFrame); @@ -141,8 +141,8 @@ static inline void drawRescaledQuad(Image *image, int srcX, int srcY, bool SafeOpenGLGraphics::drawImage2(const Image *image, int srcX, int srcY, - int dstX, int dstY, - int width, int height, bool useColor) + int dstX, int dstY, + int width, int height, bool useColor) { if (!image) return false; @@ -174,10 +174,10 @@ bool SafeOpenGLGraphics::drawImage2(const Image *image, int srcX, int srcY, } bool SafeOpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, - int dstX, int dstY, - int width, int height, - int desiredWidth, int desiredHeight, - bool useColor) + int dstX, int dstY, + int width, int height, + int desiredWidth, int desiredHeight, + bool useColor) { return drawRescaledImage(image, srcX, srcY, dstX, dstY, @@ -187,10 +187,10 @@ bool SafeOpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, } bool SafeOpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, - int dstX, int dstY, - int width, int height, - int desiredWidth, int desiredHeight, - bool useColor, bool smooth) + int dstX, int dstY, + int width, int height, + int desiredWidth, int desiredHeight, + bool useColor, bool smooth) { if (!image) return false; @@ -252,7 +252,7 @@ bool SafeOpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY, /* Optimising the functions that Graphics::drawImagePattern would call, * so that glBegin...glEnd are outside the main loop. */ void SafeOpenGLGraphics::drawImagePattern(const Image *image, int x, int y, - int w, int h) + int w, int h) { if (!image) return; @@ -296,9 +296,9 @@ void SafeOpenGLGraphics::drawImagePattern(const Image *image, int x, int y, } void SafeOpenGLGraphics::drawRescaledImagePattern(Image *image, int x, int y, - int w, int h, - int scaledWidth, - int scaledHeight) + int w, int h, + int scaledWidth, + int scaledHeight) { if (!image) return; @@ -347,15 +347,16 @@ void SafeOpenGLGraphics::drawRescaledImagePattern(Image *image, int x, int y, } bool SafeOpenGLGraphics::calcImageRect(GraphicsVertexes* vert, - int x, int y, int w, int h, - Image *topLeft A_UNUSED, - Image *topRight A_UNUSED, - Image *bottomLeft A_UNUSED, - Image *bottomRight A_UNUSED, - Image *top A_UNUSED, Image *right A_UNUSED, - Image *bottom A_UNUSED, - Image *left A_UNUSED, - Image *center A_UNUSED) + int x, int y, int w, int h, + Image *topLeft A_UNUSED, + Image *topRight A_UNUSED, + Image *bottomLeft A_UNUSED, + Image *bottomRight A_UNUSED, + Image *top A_UNUSED, + Image *right A_UNUSED, + Image *bottom A_UNUSED, + Image *left A_UNUSED, + Image *center A_UNUSED) { if (!vert) return false; @@ -365,7 +366,7 @@ bool SafeOpenGLGraphics::calcImageRect(GraphicsVertexes* vert, } void SafeOpenGLGraphics::calcTile(ImageVertexes *vert A_UNUSED, - int x A_UNUSED, int y A_UNUSED) + int x A_UNUSED, int y A_UNUSED) { } @@ -376,7 +377,7 @@ void SafeOpenGLGraphics::drawTile(ImageVertexes *vert A_UNUSED) } void SafeOpenGLGraphics::drawImageRect2(GraphicsVertexes* vert, - const ImageRect &imgRect) + const ImageRect &imgRect) { if (!vert) return; |