mail[Wesnoth-commits] r40163 - /branches/fendrin_gui_stuff/src/mouse_events.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by fabianmueller5 on December 06, 2009 - 20:49:
Author: fendrin
Date: Sun Dec  6 20:49:09 2009
New Revision: 40163

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40163&view=rev
Log:
Splited the mouse motion event. 

Modified:
    branches/fendrin_gui_stuff/src/mouse_events.cpp

Modified: branches/fendrin_gui_stuff/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/fendrin_gui_stuff/src/mouse_events.cpp?rev=40163&r1=40162&r2=40163&view=diff
==============================================================================
--- branches/fendrin_gui_stuff/src/mouse_events.cpp (original)
+++ branches/fendrin_gui_stuff/src/mouse_events.cpp Sun Dec  6 20:49:09 2009
@@ -90,20 +90,9 @@
        return 14;
 }
 
-void mouse_handler::mouse_motion(int x, int y, const bool browse, bool 
update)
+void mouse_handler::mouse_motion(const map_location& new_hex, const bool 
browse, bool update)
 {
        if (attackmove_) return;
-
-       // we ignore the position coming from event handler
-       // because it's always a little obsolete and we don't need
-       // to hightlight all the hexes where the mouse passed.
-       // Also, sometimes it seems to have one *very* obsolete
-       // and isolated mouse motion event when using drag&drop
-       SDL_GetMouseState(&x,&y);  // <-- modify x and y
-
-       if (mouse_handler_base::mouse_motion_default(x, y, update)) return;
-
-       const map_location new_hex = gui().hex_clicked_on(x,y);
 
        if(new_hex != last_hex_) {
                update = true;
@@ -249,6 +238,23 @@
        }
 }
 
+void mouse_handler::mouse_motion(int x, int y, const bool browse, bool 
update)
+{
+       // we ignore the position coming from event handler
+       // because it's always a little obsolete and we don't need
+       // to hightlight all the hexes where the mouse passed.
+       // Also, sometimes it seems to have one *very* obsolete
+       // and isolated mouse motion event when using drag&drop
+       SDL_GetMouseState(&x,&y);  // <-- modify x and y
+
+       if (mouse_handler_base::mouse_motion_default(x, y, update)) return;
+
+       const map_location new_hex = gui().hex_clicked_on(x,y);
+
+       mouse_motion(new_hex, browse, update);
+
+}
+
 unit_map::iterator mouse_handler::selected_unit()
 {
        unit_map::iterator res = find_unit(selected_hex_);




Related Messages


Powered by MHonArc, Updated Sun Dec 06 21:20:05 2009