aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx/operations.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-06-26 22:30:52 +0000
committerWillem Jan Palenstijn2009-06-26 22:30:52 +0000
commit70c9731810b28e910270429b2e5d16e2fe92f604 (patch)
tree66a6e81babf934f43c1d7be17ee8d6c3a9a3e655 /engines/sci/gfx/operations.cpp
parent27e50db5d7cdbed498d6a61b1ee1ad5405ce33a2 (diff)
downloadscummvm-rg350-70c9731810b28e910270429b2e5d16e2fe92f604.tar.gz
scummvm-rg350-70c9731810b28e910270429b2e5d16e2fe92f604.tar.bz2
scummvm-rg350-70c9731810b28e910270429b2e5d16e2fe92f604.zip
SCI: starting to restore RGB color functionality
svn-id: r41904
Diffstat (limited to 'engines/sci/gfx/operations.cpp')
-rw-r--r--engines/sci/gfx/operations.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index cb73771528..56a8b8336b 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -411,9 +411,9 @@ static void init_aux_pixmap(gfx_pixmap_t **pixmap) {
(*pixmap)->palette = new Palette(default_colors, DEFAULT_COLORS_NR);
}
-int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options, ResourceManager *resManager,
- int xfact, int yfact, gfx_color_mode_t bpp) {
- int color_depth = bpp ? bpp : 1;
+int gfxop_init(int version, bool isVGA, GfxState *state,
+ gfx_options_t *options, ResourceManager *resManager,
+ Graphics::PixelFormat mode, int xfact, int yfact) {
int initialized = 0;
BASIC_CHECKS(GFX_FATAL);
@@ -430,7 +430,7 @@ int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options,
state->pic_port_bounds = gfx_rect(0, 10, 320, 190);
state->_dirtyRects.clear();
- state->driver = new GfxDriver(xfact, yfact, bpp);
+ state->driver = new GfxDriver(xfact, yfact, mode);
state->gfxResMan = new GfxResManager(version, isVGA, state->options, state->driver, resManager);
@@ -1165,8 +1165,10 @@ static int _gfxop_set_pointer(GfxState *state, gfx_pixmap_t *pxm, Common::Point
// 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)
+ if (pxm && state->driver->getMode()->palette) {
+ assert(pxm->palette);
pxm->palette->mergeInto(state->driver->getMode()->palette);
+ }
state->driver->setPointer(pxm, hotspot);
return GFX_OK;
@@ -1761,7 +1763,8 @@ static int _gfxop_set_pic(GfxState *state) {
// 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->getMode()->palette);
+ if (state->driver->getMode()->palette)
+ state->pic->visual_map->palette->forceInto(state->driver->getMode()->palette);
_gfxop_install_pixmap(state->driver, state->pic->visual_map);
#ifdef CUSTOM_GRAPHICS_OPTIONS