summaryrefslogtreecommitdiff
path: root/src/openglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-18 17:48:29 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-18 17:49:00 +0200
commitf98d003e354a1792117b7cbc771d1dd91475a156 (patch)
treedc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/openglgraphics.cpp
parentbb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff)
downloadmanaplus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz
manaplus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2
manaplus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz
manaplus-f98d003e354a1792117b7cbc771d1dd91475a156.zip
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r--src/openglgraphics.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 6b71da13e..302c895d0 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -105,7 +105,8 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel)
logger->log("Using OpenGL %s double buffering.",
(gotDoubleBuffer ? "with" : "without"));
- char const *glExtensions = (char const *)glGetString(GL_EXTENSIONS);
+ char const *glExtensions = reinterpret_cast<char const *>(
+ glGetString(GL_EXTENSIONS));
GLint texSize;
bool rectTex = strstr(glExtensions, "GL_ARB_texture_rectangle");
if (rectTex)
@@ -631,7 +632,8 @@ void OpenGLGraphics::_beginDraw()
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glOrtho(0.0, (double)mTarget->w, (double)mTarget->h, 0.0, -1.0, 1.0);
+ glOrtho(0.0, static_cast<double>(mTarget->w),
+ static_cast<double>(mTarget->h), 0.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -681,12 +683,14 @@ SDL_Surface* OpenGLGraphics::getScreenshot()
// Flip the screenshot, as OpenGL has 0,0 in bottom left
unsigned int lineSize = 3 * w;
- GLubyte* buf = (GLubyte*)malloc(lineSize);
+ GLubyte* buf = static_cast<GLubyte*>(malloc(lineSize));
for (int i = 0; i < (h / 2); i++)
{
- GLubyte *top = (GLubyte*)screenshot->pixels + lineSize * i;
- GLubyte *bot = (GLubyte*)screenshot->pixels + lineSize * (h - 1 - i);
+ GLubyte *top = static_cast<GLubyte*>(
+ screenshot->pixels) + lineSize * i;
+ GLubyte *bot = static_cast<GLubyte*>(
+ screenshot->pixels) + lineSize * (h - 1 - i);
memcpy(buf, top, lineSize);
memcpy(top, bot, lineSize);