[Scummvm-cvs-logs] SF.net SVN: scummvm:[40859] scummvm/trunk/engines/sci/gfx

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sun May 24 14:56:06 CEST 2009


Revision: 40859
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40859&view=rev
Author:   wjpalenstijn
Date:     2009-05-24 12:56:06 +0000 (Sun, 24 May 2009)

Log Message:
-----------
SCI: re-xlate pixmap when palette revision changed

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp
    scummvm/trunk/engines/sci/gfx/gfx_system.h
    scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp

Modified: scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp	2009-05-24 11:37:24 UTC (rev 40858)
+++ scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp	2009-05-24 12:56:06 UTC (rev 40859)
@@ -646,6 +646,8 @@
 			free(pxm->data);
 		}
 	}
+	if (pxm->palette)
+		pxm->palette_revision = pxm->palette->getRevision();
 }
 
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_system.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-05-24 11:37:24 UTC (rev 40858)
+++ scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-05-24 12:56:06 UTC (rev 40859)
@@ -201,6 +201,7 @@
 			 */
 
 	int color_key;
+	int palette_revision; // Revision of palette at the time data was generated
 };
 
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-05-24 11:37:24 UTC (rev 40858)
+++ scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-05-24 12:56:06 UTC (rev 40859)
@@ -112,6 +112,7 @@
 	clone->index_data = NULL;
 	clone->palette = NULL;
 	clone->data = NULL;
+	clone->palette_revision = -1;
 	gfx_pixmap_alloc_data(clone, mode);
 
 	memcpy(clone->data, pxm->data, clone->data_size);
@@ -129,6 +130,7 @@
 	pxm->alpha_map = NULL;
 	pxm->data = NULL;
 	pxm->palette = NULL;
+	pxm->palette_revision = -1;
 
 	pxm->index_width = xl;
 	pxm->index_height = yl;

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-05-24 11:37:24 UTC (rev 40858)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-05-24 12:56:06 UTC (rev 40859)
@@ -196,8 +196,12 @@
 	if (!driver->mode->palette) return GFX_OK;
 	if (!pxm->palette) return GFX_OK;
 
+	pxm->palette->mergeInto(driver->mode->palette);
 	assert(pxm->palette->getParent() == driver->mode->palette);
 
+	if (pxm->palette_revision != pxm->palette->getRevision())
+		gfx_xlate_pixmap(pxm, driver->mode, GFX_XLATE_FILTER_NONE);
+
 	if (!driver->mode->palette->isDirty()) return GFX_OK;
 
 	// TODO: We probably want to only update the colours used by this pixmap
@@ -214,6 +218,7 @@
 
 	g_system->setPalette(paletteData, 0, paletteSize);
 	driver->mode->palette->markClean();
+
 	return GFX_OK;
 }
 


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