[Scummvm-cvs-logs] SF.net SVN: scummvm:[51012] scummvm/branches/gsoc2010-opengl/backends/ graphics/opengl/opengl-graphics.cpp

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Mon Jul 19 04:32:36 CEST 2010


Revision: 51012
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51012&view=rev
Author:   vgvgf
Date:     2010-07-19 02:32:36 +0000 (Mon, 19 Jul 2010)

Log Message:
-----------
OPENGL: Fix palette issues.

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp

Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp	2010-07-18 22:11:22 UTC (rev 51011)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp	2010-07-19 02:32:36 UTC (rev 51012)
@@ -49,8 +49,8 @@
 	_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 @@
 #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 @@
 #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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list