diff options
author | Filippos Karapetis | 2009-09-30 22:43:29 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-09-30 22:43:29 +0000 |
commit | bbb2274a7d7d57edfbf0c11271a7203c036cba7d (patch) | |
tree | e06ec57d8cde25cdef4a08e0900c73b0fa410439 /engines/sci/gfx/gfx_driver.cpp | |
parent | 598056ead0bfff5bf6b08de50cc19e159f91d35a (diff) | |
download | scummvm-rg350-bbb2274a7d7d57edfbf0c11271a7203c036cba7d.tar.gz scummvm-rg350-bbb2274a7d7d57edfbf0c11271a7203c036cba7d.tar.bz2 scummvm-rg350-bbb2274a7d7d57edfbf0c11271a7203c036cba7d.zip |
- Removed some leftover 16/32bpp color code, as we're always using palette mode now
- Simplified the mouse cursor manipulation code
svn-id: r44502
Diffstat (limited to 'engines/sci/gfx/gfx_driver.cpp')
-rw-r--r-- | engines/sci/gfx/gfx_driver.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp index dd98843e0f..15704b636c 100644 --- a/engines/sci/gfx/gfx_driver.cpp +++ b/engines/sci/gfx/gfx_driver.cpp @@ -36,10 +36,10 @@ namespace Sci { -GfxDriver::GfxDriver(int xfact, int yfact, Graphics::PixelFormat format) { +GfxDriver::GfxDriver(int xfact, int yfact) { int i; - _mode = gfx_new_mode(xfact, yfact, format, format.bytesPerPixel == 1 ? new Palette(256) : 0, 0); + _mode = gfx_new_mode(xfact, yfact, new Palette(256)); _mode->xsize = xfact * 320; _mode->ysize = yfact * 200; @@ -217,6 +217,8 @@ void GfxDriver::setPointer(gfx_pixmap_t *pointer, Common::Point *hotspot) { return; } + pointer->palette->mergeInto(_mode->palette); + // Scale cursor and map its colors to the global palette byte *cursorData = new byte[pointer->width * pointer->height]; @@ -225,9 +227,7 @@ void GfxDriver::setPointer(gfx_pixmap_t *pointer, Common::Point *hotspot) { for (int xc = 0; xc < pointer->index_width; xc++) { byte color = pointer->index_data[yc * pointer->index_width + xc]; - // FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT - // Note that some cursors don't have a palette in SQ5 - if (pointer->palette && color < pointer->palette->size()) + if (color < pointer->palette->size()) color = pointer->palette->getColor(color).getParentIndex(); memset(&linebase[xc], color, _mode->scaleFactor); } @@ -237,10 +237,8 @@ void GfxDriver::setPointer(gfx_pixmap_t *pointer, Common::Point *hotspot) { memcpy(&linebase[pointer->width * scalectr], linebase, pointer->width); } - // FIXME: The palette size check is a workaround for cursors using non-palette color GFX_CURSOR_TRANSPARENT - // Note that some cursors don't have a palette (e.g. in SQ5 and QFG3) byte color_key = pointer->color_key; - if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && (pointer->palette && (uint)pointer->color_key < pointer->palette->size())) + if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && ((uint)pointer->color_key < pointer->palette->size())) color_key = pointer->palette->getColor(pointer->color_key).getParentIndex(); CursorMan.replaceCursor(cursorData, pointer->width, pointer->height, hotspot->x, hotspot->y, color_key); |