From 78f892f87c03603d635d1ccef9c0febc214be5d9 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 23 Apr 2009 20:37:41 +0000 Subject: The mouse cursor is now working in Eco Quest 1, though the hotspot is still wrong. Many thanks to waltervn for his findings on this. svn-id: r40095 --- engines/sci/engine/kgraphics.cpp | 5 +++-- engines/sci/gfx/operations.cpp | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index d67dbd9434..486e53a79f 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -289,7 +289,7 @@ static gfx_color_t graph_map_color(EngineState *s, int color, int priority, int return retval; } -reg_t kSetCursor_SCI11(EngineState *s, int funct_nr, int argc, reg_t *argv) { +reg_t kSetCursorNew(EngineState *s, int funct_nr, int argc, reg_t *argv) { switch (argc) { case 1 : if (UKPV(0) == 0) { @@ -334,8 +334,9 @@ reg_t kSetCursor_SCI11(EngineState *s, int funct_nr, int argc, reg_t *argv) { reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) { if (s->version >= SCI_VERSION(1, 001, 000) || + s->_gameName.equalsIgnoreCase("eco") || // Eco Quest 1 needs kSetCursorNew has_kernel_function(s, "MoveCursor")) { - return kSetCursor_SCI11(s, funct_nr, argc, argv); + return kSetCursorNew(s, funct_nr, argc, argv); } if (SKPV_OR_ALT(1, 1)) { diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index 186d2acb3d..149230f0b0 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -1225,6 +1225,11 @@ int gfxop_set_pointer_view(gfx_state_t *state, int nr, int loop, int cel, Common new_pointer->yoffset = hotspot->y; } + // Special case for Eco Quest 1: The game is trying to hide the mouse cursor by clipping it, which is rejected + // by our graphics scaler. Hide the cursor when that happens instead. + if (new_pointer->width < 2 || new_pointer->height < 2) + return _gfxop_set_pointer(state, NULL); + if (!new_pointer) { GFXWARN("Attempt to set invalid pointer #%d\n", nr); return GFX_ERROR; -- cgit v1.2.3