aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-04-24 16:47:56 +0000
committerFilippos Karapetis2009-04-24 16:47:56 +0000
commitea7b19874847fd139095901f0c2d06786c86cfa1 (patch)
tree6d1c486e5101b228a3e866f1f980963f28206c7a /engines
parent10caf646189307ada4eb2070fd31e68d4d18dc83 (diff)
downloadscummvm-rg350-ea7b19874847fd139095901f0c2d06786c86cfa1.tar.gz
scummvm-rg350-ea7b19874847fd139095901f0c2d06786c86cfa1.tar.bz2
scummvm-rg350-ea7b19874847fd139095901f0c2d06786c86cfa1.zip
Merged kSetCursor and kSetCursorNew, and changed KQ5 CD to use the newer kSetCursor version
svn-id: r40120
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp52
1 files changed, 22 insertions, 30 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 7dfa6d44a3..076ddbf3c0 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -292,7 +292,7 @@ static gfx_color_t graph_map_color(EngineState *s, int color, int priority, int
return retval;
}
-reg_t kSetCursorNew(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) {
switch (argc) {
case 1 :
if (UKPV(0) == 0) {
@@ -306,14 +306,29 @@ reg_t kSetCursorNew(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->mouse_pointer_loop = s->save_mouse_pointer_loop;
s->mouse_pointer_cel = s->save_mouse_pointer_cel;
}
- case 2 : {
- Common::Point pt;
- pt.x = UKPV(0);
- pt.y = UKPV(1);
+ case 2 :
+ case 4 :
+ if (s->version >= SCI_VERSION(1, 1, 0) ||
+ s->_gameName.equalsIgnoreCase("eco") ||
+ (s->_gameName.equalsIgnoreCase("KQ5") && s->version == SCI_VERSION(1, 000, 784)) // KQ5 CD
+ ) {
+ GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, Common::Point(UKPV(0), UKPV(1))));
+ } else {
+ if (SKPV_OR_ALT(1, 1)) {
+ s->mouse_pointer_view = SKPV(0);
+ } else
+ s->mouse_pointer_view = GFXOP_NO_POINTER;
+
+ s->mouse_pointer_loop = s->mouse_pointer_cel = 0; // Not used with cursor-format pointers
- GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, pt));
+ GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, s->mouse_pointer_view));
+
+ if (argc > 2) {
+ Common::Point newpos = Common::Point(SKPV(2) + s->port->_bounds.x, SKPV(3) + s->port->_bounds.y);
+ GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, newpos));
+ }
+ }
break;
- }
case 3 : {
GFX_ASSERT(gfxop_set_pointer_view(s->gfx_state, UKPV(0), UKPV(1), UKPV(2), NULL));
s->mouse_pointer_view = UKPV(0);
@@ -336,29 +351,6 @@ reg_t kSetCursorNew(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
-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
- return kSetCursorNew(s, funct_nr, argc, argv);
- }
-
- if (SKPV_OR_ALT(1, 1)) {
- s->mouse_pointer_view = SKPV(0);
- } else
- s->mouse_pointer_view = GFXOP_NO_POINTER;
-
- s->mouse_pointer_loop = s->mouse_pointer_cel = 0; // Not used with cursor-format pointers
-
- GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, s->mouse_pointer_view));
-
- if (argc > 2) {
- Common::Point newpos = Common::Point(SKPV(2) + s->port->_bounds.x, SKPV(3) + s->port->_bounds.y);
- GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, newpos));
- }
-
- return s->r_acc;
-}
-
extern int oldx, oldy;
reg_t kMoveCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) {