summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-19 21:15:55 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-19 21:15:55 +0300
commit4503b047574e1374d16d2bec7e10285f59cc6d51 (patch)
treed7efb46c3154b2dd1487751d18c4a2f91ec87c07
parentc4acdd1997b5bdc7b70e52ea90354ee65f15360a (diff)
downloadmv-4503b047574e1374d16d2bec7e10285f59cc6d51.tar.gz
mv-4503b047574e1374d16d2bec7e10285f59cc6d51.tar.bz2
mv-4503b047574e1374d16d2bec7e10285f59cc6d51.tar.xz
mv-4503b047574e1374d16d2bec7e10285f59cc6d51.zip
Rename opengl1graphics to safeopenglgraphics.
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/Makefile.am4
-rw-r--r--src/compoundsprite.cpp2
-rw-r--r--src/graphicsmanager.cpp2
-rw-r--r--src/graphicsvertexes.h6
-rw-r--r--src/resources/image.cpp2
-rw-r--r--src/resources/image.h2
-rw-r--r--src/resources/openglimagehelper.cpp4
-rw-r--r--src/resources/subimage.cpp2
-rw-r--r--src/safeopenglgraphics.cpp (renamed from src/opengl1graphics.cpp)60
-rw-r--r--src/safeopenglgraphics.h (renamed from src/opengl1graphics.h)6
11 files changed, 47 insertions, 47 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7fe4630b3..94d39ed4a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -586,8 +586,6 @@ SET(SRCS
map.h
maplayer.cpp
maplayer.h
- opengl1graphics.cpp
- opengl1graphics.h
openglgraphics.cpp
openglgraphics.h
particle.cpp
@@ -608,6 +606,8 @@ SET(SRCS
properties.h
rotationalparticle.cpp
rotationalparticle.h
+ safeopenglgraphics.cpp
+ safeopenglgraphics.h
shopitem.cpp
shopitem.h
simpleanimation.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 00a136b4a..b69cce69b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -599,8 +599,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
map.h \
maplayer.cpp \
maplayer.h \
- opengl1graphics.cpp\
- opengl1graphics.h \
openglgraphics.cpp\
openglgraphics.h \
particle.cpp \
@@ -621,6 +619,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
properties.h \
rotationalparticle.cpp \
rotationalparticle.h \
+ safeopenglgraphics.cpp\
+ safeopenglgraphics.h \
shopitem.cpp \
shopitem.h \
simpleanimation.cpp \
diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp
index 98ee8c6df..f3ccac072 100644
--- a/src/compoundsprite.cpp
+++ b/src/compoundsprite.cpp
@@ -27,7 +27,7 @@
#ifdef USE_OPENGL
#include "openglgraphics.h"
-#include "opengl1graphics.h"
+#include "safeopenglgraphics.h"
#endif
#include "client.h"
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index e32cf24ef..f18f8c03d 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -172,7 +172,7 @@ void GraphicsManager::initGraphics(bool noOpenGL)
break;
case 2:
imageHelper = new OpenGLImageHelper;
- mainGraphics = new OpenGL1Graphics;
+ mainGraphics = new SafeOpenGLGraphics;
break;
};
diff --git a/src/graphicsvertexes.h b/src/graphicsvertexes.h
index a4ce65013..70ba4847b 100644
--- a/src/graphicsvertexes.h
+++ b/src/graphicsvertexes.h
@@ -33,7 +33,7 @@
#include <SDL_opengl.h>
-#include "opengl1graphics.h"
+#include "safeopenglgraphics.h"
#include "openglgraphics.h"
#endif
@@ -61,7 +61,7 @@ class SDLGraphicsVertexes
};
#ifdef USE_OPENGL
-class OpenGL1GraphicsVertexes
+class SafeOpenGLGraphicsVertexes
{
};
@@ -147,7 +147,7 @@ class GraphicsVertexes
SDLGraphicsVertexes sdl[5];
#ifdef USE_OPENGL
-// OpenGL1GraphicsVertexes ogl1[5];
+// SafeOpenGLGraphicsVertexes ogl1[5];
OpenGLGraphicsVertexes ogl[5];
#endif
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index c642980af..342bca1b5 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -27,7 +27,7 @@
#ifdef USE_OPENGL
#include "openglgraphics.h"
-#include "opengl1graphics.h"
+#include "safeopenglgraphics.h"
#endif
#include "client.h"
diff --git a/src/resources/image.h b/src/resources/image.h
index 59178cca6..756c9e23d 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -60,7 +60,7 @@ class Image : public Resource
friend class SDLImageHelper;
#ifdef USE_OPENGL
friend class OpenGLGraphics;
- friend class OpenGL1Graphics;
+ friend class SafeOpenGLGraphics;
#endif
public:
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index ae3b55741..120288b3f 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -28,7 +28,7 @@
#include "resources/resourcemanager.h"
#include "openglgraphics.h"
-#include "opengl1graphics.h"
+#include "safeopenglgraphics.h"
#include "client.h"
#include "logger.h"
@@ -215,7 +215,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage)
if (mUseOpenGL == 1)
OpenGLGraphics::bindTexture(mTextureType, texture);
else if (mUseOpenGL == 2)
- OpenGL1Graphics::bindTexture(mTextureType, texture);
+ SafeOpenGLGraphics::bindTexture(mTextureType, texture);
if (SDL_MUSTLOCK(tmpImage))
SDL_LockSurface(tmpImage);
diff --git a/src/resources/subimage.cpp b/src/resources/subimage.cpp
index 294a966c4..1b9f745d3 100644
--- a/src/resources/subimage.cpp
+++ b/src/resources/subimage.cpp
@@ -24,7 +24,7 @@
#ifdef USE_OPENGL
#include "openglgraphics.h"
-#include "opengl1graphics.h"
+#include "safeopenglgraphics.h"
#endif
#include "client.h"
diff --git a/src/opengl1graphics.cpp b/src/safeopenglgraphics.cpp
index 88079c2bd..cc8bcc95b 100644
--- a/src/opengl1graphics.cpp
+++ b/src/safeopenglgraphics.cpp
@@ -23,7 +23,7 @@
#include "main.h"
#ifdef USE_OPENGL
-#include "opengl1graphics.h"
+#include "safeopenglgraphics.h"
#include "configuration.h"
#include "graphicsvertexes.h"
@@ -41,9 +41,9 @@
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
#endif
-GLuint OpenGL1Graphics::mLastImage = 0;
+GLuint SafeOpenGLGraphics::mLastImage = 0;
-OpenGL1Graphics::OpenGL1Graphics():
+SafeOpenGLGraphics::SafeOpenGLGraphics():
mAlpha(false), mTexture(false), mColorAlpha(false),
mFboId(0), mTextureId(0), mRboId(0)
{
@@ -51,11 +51,11 @@ OpenGL1Graphics::OpenGL1Graphics():
mName = "safe OpenGL";
}
-OpenGL1Graphics::~OpenGL1Graphics()
+SafeOpenGLGraphics::~SafeOpenGLGraphics()
{
}
-bool OpenGL1Graphics::setVideoMode(int w, int h, int bpp, bool fs,
+bool SafeOpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs,
bool hwaccel, bool resize, bool noFrame)
{
setMainFlags(w, h, bpp, fs, hwaccel, resize, noFrame);
@@ -140,7 +140,7 @@ static inline void drawRescaledQuad(Image *image, int srcX, int srcY,
}
-bool OpenGL1Graphics::drawImage2(const 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)
{
@@ -173,7 +173,7 @@ bool OpenGL1Graphics::drawImage2(const Image *image, int srcX, int srcY,
return true;
}
-bool OpenGL1Graphics::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,
@@ -186,7 +186,7 @@ bool OpenGL1Graphics::drawRescaledImage(Image *image, int srcX, int srcY,
useColor, true);
}
-bool OpenGL1Graphics::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,
@@ -251,7 +251,7 @@ bool OpenGL1Graphics::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 OpenGL1Graphics::drawImagePattern(const Image *image, int x, int y,
+void SafeOpenGLGraphics::drawImagePattern(const Image *image, int x, int y,
int w, int h)
{
if (!image)
@@ -295,7 +295,7 @@ void OpenGL1Graphics::drawImagePattern(const Image *image, int x, int y,
static_cast<GLubyte>(mColor.a));
}
-void OpenGL1Graphics::drawRescaledImagePattern(Image *image, int x, int y,
+void SafeOpenGLGraphics::drawRescaledImagePattern(Image *image, int x, int y,
int w, int h,
int scaledWidth,
int scaledHeight)
@@ -346,7 +346,7 @@ void OpenGL1Graphics::drawRescaledImagePattern(Image *image, int x, int y,
static_cast<GLubyte>(mColor.b), static_cast<GLubyte>(mColor.a));
}
-bool OpenGL1Graphics::calcImageRect(GraphicsVertexes* vert,
+bool SafeOpenGLGraphics::calcImageRect(GraphicsVertexes* vert,
int x, int y, int w, int h,
Image *topLeft A_UNUSED,
Image *topRight A_UNUSED,
@@ -364,18 +364,18 @@ bool OpenGL1Graphics::calcImageRect(GraphicsVertexes* vert,
return true;
}
-void OpenGL1Graphics::calcTile(ImageVertexes *vert A_UNUSED,
+void SafeOpenGLGraphics::calcTile(ImageVertexes *vert A_UNUSED,
int x A_UNUSED, int y A_UNUSED)
{
}
-void OpenGL1Graphics::drawTile(ImageVertexes *vert A_UNUSED)
+void SafeOpenGLGraphics::drawTile(ImageVertexes *vert A_UNUSED)
{
}
-void OpenGL1Graphics::drawImageRect2(GraphicsVertexes* vert,
+void SafeOpenGLGraphics::drawImageRect2(GraphicsVertexes* vert,
const ImageRect &imgRect)
{
if (!vert)
@@ -387,14 +387,14 @@ void OpenGL1Graphics::drawImageRect2(GraphicsVertexes* vert,
imgRect.grid[4]);
}
-void OpenGL1Graphics::updateScreen()
+void SafeOpenGLGraphics::updateScreen()
{
glFlush();
glFinish();
SDL_GL_SwapBuffers();
}
-void OpenGL1Graphics::_beginDraw()
+void SafeOpenGLGraphics::_beginDraw()
{
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
@@ -415,12 +415,12 @@ void OpenGL1Graphics::_beginDraw()
pushClipArea(gcn::Rectangle(0, 0, mTarget->w, mTarget->h));
}
-void OpenGL1Graphics::_endDraw()
+void SafeOpenGLGraphics::_endDraw()
{
popClipArea();
}
-void OpenGL1Graphics::prepareScreenshot()
+void SafeOpenGLGraphics::prepareScreenshot()
{
#if !defined(_WIN32)
if (config.getBoolValue("usefbo"))
@@ -464,7 +464,7 @@ void OpenGL1Graphics::prepareScreenshot()
#endif
}
-SDL_Surface* OpenGL1Graphics::getScreenshot()
+SDL_Surface* SafeOpenGLGraphics::getScreenshot()
{
const int h = mTarget->h;
const int w = mTarget->w - (mTarget->w % 4);
@@ -535,7 +535,7 @@ SDL_Surface* OpenGL1Graphics::getScreenshot()
return screenshot;
}
-bool OpenGL1Graphics::pushClipArea(gcn::Rectangle area)
+bool SafeOpenGLGraphics::pushClipArea(gcn::Rectangle area)
{
int transX = 0;
int transY = 0;
@@ -562,7 +562,7 @@ bool OpenGL1Graphics::pushClipArea(gcn::Rectangle area)
return result;
}
-void OpenGL1Graphics::popClipArea()
+void SafeOpenGLGraphics::popClipArea()
{
gcn::Graphics::popClipArea();
@@ -575,7 +575,7 @@ void OpenGL1Graphics::popClipArea()
clipArea.width, clipArea.height);
}
-void OpenGL1Graphics::setColor(const gcn::Color& color)
+void SafeOpenGLGraphics::setColor(const gcn::Color& color)
{
mColor = color;
glColor4ub(static_cast<GLubyte>(color.r),
@@ -586,7 +586,7 @@ void OpenGL1Graphics::setColor(const gcn::Color& color)
mColorAlpha = (color.a != 255);
}
-void OpenGL1Graphics::drawPoint(int x, int y)
+void SafeOpenGLGraphics::drawPoint(int x, int y)
{
setTexturingAndBlending(false);
@@ -595,7 +595,7 @@ void OpenGL1Graphics::drawPoint(int x, int y)
glEnd();
}
-void OpenGL1Graphics::drawLine(int x1, int y1, int x2, int y2)
+void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2)
{
setTexturingAndBlending(false);
@@ -609,21 +609,21 @@ void OpenGL1Graphics::drawLine(int x1, int y1, int x2, int y2)
glEnd();
}
-void OpenGL1Graphics::drawRectangle(const gcn::Rectangle& rect)
+void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect)
{
drawRectangle(rect, false);
}
-void OpenGL1Graphics::fillRectangle(const gcn::Rectangle& rect)
+void SafeOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect)
{
drawRectangle(rect, true);
}
-void OpenGL1Graphics::setTargetPlane(int width A_UNUSED, int height A_UNUSED)
+void SafeOpenGLGraphics::setTargetPlane(int width A_UNUSED, int height A_UNUSED)
{
}
-void OpenGL1Graphics::setTexturingAndBlending(bool enable)
+void SafeOpenGLGraphics::setTexturingAndBlending(bool enable)
{
if (enable)
{
@@ -661,7 +661,7 @@ void OpenGL1Graphics::setTexturingAndBlending(bool enable)
}
}
-void OpenGL1Graphics::drawRectangle(const gcn::Rectangle& rect, bool filled)
+void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, bool filled)
{
const float offset = filled ? 0 : 0.5f;
@@ -679,7 +679,7 @@ void OpenGL1Graphics::drawRectangle(const gcn::Rectangle& rect, bool filled)
glEnd();
}
-void OpenGL1Graphics::bindTexture(GLenum target, GLuint texture)
+void SafeOpenGLGraphics::bindTexture(GLenum target, GLuint texture)
{
if (mLastImage != texture)
{
diff --git a/src/opengl1graphics.h b/src/safeopenglgraphics.h
index 5c4d7ffb7..304c62d85 100644
--- a/src/opengl1graphics.h
+++ b/src/safeopenglgraphics.h
@@ -34,12 +34,12 @@
#include <SDL_opengl.h>
#include <GL/glext.h>
-class OpenGL1Graphics : public Graphics
+class SafeOpenGLGraphics : public Graphics
{
public:
- OpenGL1Graphics();
+ SafeOpenGLGraphics();
- ~OpenGL1Graphics();
+ ~SafeOpenGLGraphics();
bool setVideoMode(int w, int h, int bpp, bool fs,
bool hwaccel, bool resize, bool noFrame);