aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-13 17:09:32 +0000
committerFilippos Karapetis2009-10-13 17:09:32 +0000
commit4e0046dd1f1cd342bd0c2c8b1f7367299e117d15 (patch)
treee61932ec2bcc65ff270d6a609bd9b6348b4ead46 /engines/sci/gfx
parent5aa141539786c4f905addfd0c05f6e00dfd3afd7 (diff)
downloadscummvm-rg350-4e0046dd1f1cd342bd0c2c8b1f7367299e117d15.tar.gz
scummvm-rg350-4e0046dd1f1cd342bd0c2c8b1f7367299e117d15.tar.bz2
scummvm-rg350-4e0046dd1f1cd342bd0c2c8b1f7367299e117d15.zip
Merged the rest of the cursor code
svn-id: r45029
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/gfx_driver.cpp39
-rw-r--r--engines/sci/gfx/gfx_driver.h19
-rw-r--r--engines/sci/gfx/operations.cpp19
-rw-r--r--engines/sci/gfx/operations.h15
4 files changed, 0 insertions, 92 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index 78ed7620e9..8ac2e8e1d9 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -183,45 +183,6 @@ void GfxDriver::setStaticBuffer(gfx_pixmap_t *pic, gfx_pixmap_t *priority) {
memcpy(_screen->_controlScreen, priority->index_data, _mode->xsize * _mode->ysize);
}
-// Mouse pointer operations
-
-void GfxDriver::setPointer(gfx_pixmap_t *pointer, Common::Point *hotspot) {
- if (!pointer || !hotspot) {
- CursorMan.showMouse(false);
- return;
- }
-
- pointer->palette->mergeInto(_mode->palette);
-
- // Scale cursor and map its colors to the global palette
- byte *cursorData = new byte[pointer->width * pointer->height];
-
- for (int yc = 0; yc < pointer->index_height; yc++) {
- byte *linebase = &cursorData[yc * (pointer->width * _mode->scaleFactor)];
-
- for (int xc = 0; xc < pointer->index_width; xc++) {
- byte color = pointer->index_data[yc * pointer->index_width + xc];
- if (color < pointer->palette->size())
- color = pointer->palette->getColor(color).getParentIndex();
- memset(&linebase[xc], color, _mode->scaleFactor);
- }
-
- // Scale vertically
- for (int scalectr = 1; scalectr < _mode->scaleFactor; scalectr++)
- memcpy(&linebase[pointer->width * scalectr], linebase, pointer->width);
- }
-
- byte color_key = pointer->color_key;
- 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);
- CursorMan.showMouse(true);
-
- delete[] cursorData;
- cursorData = 0;
-}
-
void GfxDriver::animatePalette(int fromColor, int toColor, int stepCount) {
int i;
PaletteEntry firstColor = _mode->palette->getColor(fromColor);
diff --git a/engines/sci/gfx/gfx_driver.h b/engines/sci/gfx/gfx_driver.h
index 8983111b5b..5fb6b35ef3 100644
--- a/engines/sci/gfx/gfx_driver.h
+++ b/engines/sci/gfx/gfx_driver.h
@@ -206,25 +206,6 @@ public:
void setStaticBuffer(gfx_pixmap_t *pic, gfx_pixmap_t *priority);
/** @} */
- /** @name Mouse pointer operations */
- /** @{ */
-
- /**
- * Sets a new mouse pointer.
- *
- * If pointer is not NULL, it will have been scaled to the appropriate
- * size and registered as a pixmap (if neccessary) beforehand. If this
- * function is called for a target that supports only two-color
- * pointers, the image is a color index image, where only color index
- * values 0, 1, and GFX_COLOR_INDEX_TRANSPARENT are used.
- *
- * @param[in] pointer The pointer to set, or NULL to set no pointer.
- * @param[in] hotspot The coordinates of the hotspot, or NULL to set
- * no pointer.
- */
- void setPointer(gfx_pixmap_t *pointer, Common::Point *hotspot);
- /** @} */
-
gfx_mode_t *getMode() { return _mode; }
/**
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index a07188bca6..06549050a7 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -967,25 +967,6 @@ void gfxop_sleep(GfxState *state, uint32 msecs) {
}
}
-void gfxop_set_pointer_view(GfxState *state, int nr, int loop, int cel, Common::Point *hotspot) {
- // FIXME: For now, don't palettize pointers
- gfx_pixmap_t *new_pointer = state->gfxResMan->getView(nr, &loop, &cel, 0)->loops[loop].cels[cel];
-
- // Eco Quest 1 uses a 1x1 transparent cursor to hide the cursor from the user. Some scalers don't seem to support this.
- if (new_pointer->width < 2 || new_pointer->height < 2) {
- state->driver->setPointer(NULL, NULL);
- return;
- }
-
- if (hotspot)
- state->driver->setPointer(new_pointer, hotspot);
- else {
- // Compute hotspot from xoffset/yoffset
- Common::Point p = Common::Point(new_pointer->xoffset + (new_pointer->width >> 1), new_pointer->yoffset + new_pointer->height - 1);
- state->driver->setPointer(new_pointer, &p);
- }
-}
-
#define SCANCODE_ROWS_NR 3
struct scancode_row {
diff --git a/engines/sci/gfx/operations.h b/engines/sci/gfx/operations.h
index ea2078f49a..e620fc9833 100644
--- a/engines/sci/gfx/operations.h
+++ b/engines/sci/gfx/operations.h
@@ -40,8 +40,6 @@ namespace Sci {
struct TextFragment;
-#define GFXOP_NO_POINTER -1
-
/* Threshold in color index mode to differentiate between visible and non-visible stuff.
** GFXOP_ALPHA_THRESHOLD itself should be treated as non-visible.
*/
@@ -364,19 +362,6 @@ void gfxop_free_color(GfxState *state, gfx_color_t *color);
void gfxop_sleep(GfxState *state, uint32 msecs);
/**
- * Sets the mouse pointer to a view resource.
- *
- * Use gfxop_set_pointer_cursor(state, GFXOP_NO_POINTER) to disable the pointer.
- *
- * @param[in] state The affected state
- * @param[in] nr Number of the view resource to use
- * @param[in] loop View loop to use
- * @param[in] cel View cel to use
- * @param[in] hotspot Manually set hotspot to use, or NULL for default.
- */
-void gfxop_set_pointer_view(GfxState *state, int nr, int loop, int cel, Common::Point *hotspot);
-
-/**
* Retrieves the next input event from the driver.
*
* @param[in] state The affected state