[Scummvm-cvs-logs] SF.net SVN: scummvm:[40870] scummvm/trunk/engines/sci/gfx/operations.cpp
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Sun May 24 20:41:19 CEST 2009
Revision: 40870
http://scummvm.svn.sourceforge.net/scummvm/?rev=40870&view=rev
Author: wjpalenstijn
Date: 2009-05-24 18:41:19 +0000 (Sun, 24 May 2009)
Log Message:
-----------
SCI: reset system palette when loading a new PIC.
This improves the colours of background images, but is still partially
broken. The mouse cursor becomes transparent when changing scenes, and
there is a brief moment of palette corruption between scenes.
Modified Paths:
--------------
scummvm/trunk/engines/sci/gfx/operations.cpp
Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp 2009-05-24 17:08:03 UTC (rev 40869)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp 2009-05-24 18:41:19 UTC (rev 40870)
@@ -1178,6 +1178,12 @@
static int _gfxop_set_pointer(GfxState *state, gfx_pixmap_t *pxm, Common::Point *hotspot) {
BASIC_CHECKS(GFX_FATAL);
+ // FIXME: We may have to store this pxm somewhere, as the global palette
+ // may change when a new PIC is loaded. The cursor has to be regenerated
+ // from this pxm at that point. (An alternative might be to ensure the
+ // cursor only uses colours in the static part of the palette?)
+ if (pxm && pxm->palette)
+ pxm->palette->mergeInto(state->driver->mode->palette);
state->driver->set_pointer(state->driver, pxm, hotspot);
return GFX_OK;
@@ -1801,6 +1807,11 @@
gfx_copy_pixmap_box_i(state->priority_map, state->pic_unscaled->priority_map, gfx_rect(0, 0, 320, 200));
gfx_copy_pixmap_box_i(state->static_priority_map, state->pic_unscaled->priority_map, gfx_rect(0, 0, 320, 200));
+ // Reset global palette to this PIC's palette
+ // FIXME: The _gfxop_install_pixmap call below updates the OSystem palette.
+ // This is too soon, since it causes brief palette corruption until the
+ // screen is updated too. (Possibly related: EngineState::pic_not_valid .)
+ state->pic->visual_map->palette->forceInto(state->driver->mode->palette);
_gfxop_install_pixmap(state->driver, state->pic->visual_map);
#ifdef CUSTOM_GRAPHICS_OPTIONS
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