diff options
| author | Filippos Karapetis | 2009-05-27 16:45:42 +0000 | 
|---|---|---|
| committer | Filippos Karapetis | 2009-05-27 16:45:42 +0000 | 
| commit | c75bdbc8e95946e1388fa45b086f8f37566ce886 (patch) | |
| tree | 636e534e235d1535cc641271e9a81d71593fb343 /engines/sci/gfx/gfx_driver.cpp | |
| parent | 9fd5611fe4f03c7e8cd61edf077c1f6bcf699008 (diff) | |
| download | scummvm-rg350-c75bdbc8e95946e1388fa45b086f8f37566ce886.tar.gz scummvm-rg350-c75bdbc8e95946e1388fa45b086f8f37566ce886.tar.bz2 scummvm-rg350-c75bdbc8e95946e1388fa45b086f8f37566ce886.zip  | |
- SQ5 floppy starts now
- Added a new console command, "room", which shows the current room
svn-id: r40943
Diffstat (limited to 'engines/sci/gfx/gfx_driver.cpp')
| -rw-r--r-- | engines/sci/gfx/gfx_driver.cpp | 10 | 
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp index e4f6a40120..8ee2b3977e 100644 --- a/engines/sci/gfx/gfx_driver.cpp +++ b/engines/sci/gfx/gfx_driver.cpp @@ -264,7 +264,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;  			// FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT -			if (color < pointer->palette->size()) +			// Note that some cursors don't have a palette in SQ5 +			if (pointer->palette && color < pointer->palette->size())  				color = pointer->palette->getColor(color).parent_index;  			for (int scalectr = 0; scalectr < drv->mode->xfact; scalectr++) {  				*pos++ = color; @@ -287,9 +288,14 @@ static int scummvm_set_pointer(gfx_driver_t *drv, gfx_pixmap_t *pointer, Common:  		S->pointer_data = create_cursor(drv, pointer, 1);  		// 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  		uint8 color_key = GFX_CURSOR_TRANSPARENT; -		if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && ((unsigned int)pointer->color_key < pointer->palette->size())) +		if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && (pointer->palette && (unsigned int)pointer->color_key < pointer->palette->size()))  			color_key = pointer->palette->getColor(pointer->color_key).parent_index; +		// Some cursors in SQ5 don't have a palette. The cursor palette seems to use 64 colors, so setting the color key to 63 works +		// TODO: Is this correct? +		if (!pointer->palette) +			color_key = 63;  		g_system->setMouseCursor(S->pointer_data, pointer->width, pointer->height, hotspot->x, hotspot->y, color_key);  		g_system->showMouse(true);  | 
