diff options
author | Walter van Niftrik | 2009-04-24 14:30:27 +0000 |
---|---|---|
committer | Walter van Niftrik | 2009-04-24 14:30:27 +0000 |
commit | 8d3cb3bd5f60895fe41bb515b3106d19959b98cf (patch) | |
tree | 2ec4c82fc92aeae32bf68c0f84d5cb88148f4f39 /engines/sci/gfx/gfx_driver.cpp | |
parent | 6f60e0dd48aea56c47af0b682ab9ddcc4fcc570b (diff) | |
download | scummvm-rg350-8d3cb3bd5f60895fe41bb515b3106d19959b98cf.tar.gz scummvm-rg350-8d3cb3bd5f60895fe41bb515b3106d19959b98cf.tar.bz2 scummvm-rg350-8d3cb3bd5f60895fe41bb515b3106d19959b98cf.zip |
SCI: Fix transparency in view-based mouse cursors.
svn-id: r40116
Diffstat (limited to 'engines/sci/gfx/gfx_driver.cpp')
-rw-r--r-- | engines/sci/gfx/gfx_driver.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp index aa8bbc98ac..ffe161d846 100644 --- a/engines/sci/gfx/gfx_driver.cpp +++ b/engines/sci/gfx/gfx_driver.cpp @@ -271,7 +271,8 @@ static uint8 *create_cursor(gfx_driver_t *drv, gfx_pixmap_t *pointer, int mode) for (int xc = 0; xc < pointer->index_width; xc++) { uint8 color = *src; - if (color != 255) + // FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT + if (color < pointer->palette->size()) color = pointer->palette->getColor(color).parent_index; for (int scalectr = 0; scalectr < drv->mode->xfact; scalectr++) { *pos++ = color; @@ -292,7 +293,13 @@ static int scummvm_set_pointer(gfx_driver_t *drv, gfx_pixmap_t *pointer, Common: } else { delete[] S->pointer_data; S->pointer_data = create_cursor(drv, pointer, 1); - g_system->setMouseCursor(S->pointer_data, pointer->width, pointer->height, hotspot->x, hotspot->y); + + // FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT + uint8 color_key = GFX_CURSOR_TRANSPARENT; + if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && ((unsigned int)pointer->color_key < pointer->palette->size())) + color_key = pointer->palette->getColor(pointer->color_key).parent_index; + + g_system->setMouseCursor(S->pointer_data, pointer->width, pointer->height, hotspot->x, hotspot->y, color_key); g_system->showMouse(true); } |