From: <js...@us...> - 2004-08-05 07:06:53
|
Update of /cvsroot/exult/exult In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32337 Modified Files: drag.cc drag.h exult.cc Log Message: Show hand cursor when dragging objs Index: drag.cc =================================================================== RCS file: /cvsroot/exult/exult/drag.cc,v retrieving revision 1.129 retrieving revision 1.130 diff -u -d -r1.129 -r1.130 --- drag.cc 26 Jun 2004 23:00:33 -0000 1.129 +++ drag.cc 5 Aug 2004 07:06:41 -0000 1.130 @@ -25,10 +25,10 @@ #include <iostream> /* Debugging */ #include "gamewin.h" #include "gamemap.h" +#include "mouse.h" #include "drag.h" #include "Gump_button.h" #include "Gump.h" -#include "mouse.h" #include "paths.h" #include "actors.h" #include "cheat.h" @@ -53,6 +53,7 @@ old_foot(0, 0, 0, 0), old_lift(-1), quantity(obj->get_quantity()), paintx(-1000), painty(-1000), readied_index(-1), mousex(-1), mousey(-1), rect(0, 0, 0, 0), + mouse_shape(Mouse::mouse->get_shape()), save(0), okay(true), possible_theft(false) { rect = gwin->get_shape_rect(obj); @@ -71,6 +72,7 @@ ) : obj(0), is_new(false), gump(0), button(0), old_pos(-1, -1, -1), old_foot(0, 0, 0, 0), old_lift(-1), quantity(0), readied_index(-1), mousex(x), mousey(y), rect(0, 0, 0, 0), + mouse_shape(Mouse::mouse->get_shape()), save(0), okay(false), possible_theft(false) { // First see if it's a gump. @@ -174,6 +176,7 @@ } } } + Mouse::mouse->set_shape(Mouse::hand); // Store original pos. on screen. rect = gump ? (obj ? gump->get_shape_rect(obj) : gump->get_dirty()) : gwin->get_shape_rect(obj); @@ -270,6 +273,7 @@ ) { bool handled = moved; + Mouse::mouse->set_shape(mouse_shape); if (button) { button->unpush(); Index: drag.h =================================================================== RCS file: /cvsroot/exult/exult/drag.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- drag.h 31 Aug 2003 17:32:23 -0000 1.5 +++ drag.h 5 Aug 2004 07:06:41 -0000 1.6 @@ -40,6 +40,7 @@ int readied_index; // If it was a 'readied' item. // Last mouse, paint positions: int mousex, mousey, paintx, painty; + Mouse::Mouse_shapes mouse_shape;// Save starting mouse shape. Rectangle rect; // Rectangle to repaint. Image_buffer *save; // Image below dragged object. bool okay; // True if drag constructed okay. Index: exult.cc =================================================================== RCS file: /cvsroot/exult/exult/exult.cc,v retrieving revision 1.464 retrieving revision 1.465 diff -u -d -r1.464 -r1.465 --- exult.cc 3 Aug 2004 09:12:23 -0000 1.464 +++ exult.cc 5 Aug 2004 07:06:41 -0000 1.465 @@ -1102,6 +1102,7 @@ if (dragging) { click_handled = gwin->drop_dragged(x, y, dragged); + Mouse::mouse->set_speed_cursor(); } // Last click within .5 secs? if (curtime - last_b1_click < 500) @@ -1127,7 +1128,8 @@ { Mouse::mouse->move(event.motion.x / scale, event.motion.y / scale); - Mouse::mouse->set_speed_cursor(); + if (!dragging) + Mouse::mouse->set_speed_cursor(); Mouse::mouse_update = true; // Need to blit mouse. right_on_gump = false; |