aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-19 02:32:36 +0000
committerAlejandro Marzini2010-07-19 02:32:36 +0000
commit7ad017bde0eb6850b1c2c5012a88ae3cc9dbd75c (patch)
treedea772a97d0558a7628e25cf1403c1330729de01 /backends
parent03d66c401214ecc02021b00d42ade314c16e0201 (diff)
downloadscummvm-rg350-7ad017bde0eb6850b1c2c5012a88ae3cc9dbd75c.tar.gz
scummvm-rg350-7ad017bde0eb6850b1c2c5012a88ae3cc9dbd75c.tar.bz2
scummvm-rg350-7ad017bde0eb6850b1c2c5012a88ae3cc9dbd75c.zip
OPENGL: Fix palette issues.
svn-id: r51012
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index aecd342c15..e2b541bef8 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -49,8 +49,8 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
_videoMode.scaleFactor = 1;
_videoMode.fullscreen = false;
- _gamePalette = (byte *)calloc(sizeof(byte), 256);
- _cursorPalette = (byte *)calloc(sizeof(byte), 256);
+ _gamePalette = (byte *)calloc(sizeof(byte) * 4, 256);
+ _cursorPalette = (byte *)calloc(sizeof(byte) * 4, 256);
// Register the graphics manager as a event observer
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 2, false);
@@ -285,7 +285,7 @@ void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num)
#endif
// Save the screen palette
- memcpy(_cursorPalette + start * 4, colors, num * 4);
+ memcpy(_gamePalette + start * 4, colors, num * 4);
if (_cursorPaletteDisabled)
_cursorNeedsRedraw = true;
@@ -299,7 +299,7 @@ void OpenGLGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
#endif
// Copies current palette to buffer
- memcpy(colors, _cursorPalette + start * 4, num * 4);
+ memcpy(colors, _gamePalette + start * 4, num * 4);
}
void OpenGLGraphicsManager::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {