Fixed mouse move problem
authorNathan Heisey <nathanheisey@gmail.com>
Tue, 26 Jul 2011 11:38:20 +0000
changeset 5927463b84c19645
parent 5926 d9d57de9fb4e
child 5928 a3a52295bc0d
Fixed mouse move problem
src/main/beos/SDL_BApp.h
src/video/bwindow/SDL_BWin.h
src/video/bwindow/SDL_bmodes.cc
     1.1 --- a/src/main/beos/SDL_BApp.h	Tue Jul 26 10:13:34 2011 +0000
     1.2 +++ b/src/main/beos/SDL_BApp.h	Tue Jul 26 11:38:20 2011 +0000
     1.3 @@ -202,16 +202,16 @@
     1.4  	void _HandleMouseMove(BMessage *msg) {
     1.5  		SDL_Window *win;
     1.6  		int32 winID;
     1.7 -		int32 dx, dy;
     1.8 +		int32 x = 0, y = 0;
     1.9  		if(	
    1.10  			!_GetWinID(msg, &winID) ||
    1.11 -			msg->FindInt32("dx", &dx) != B_OK || /* x movement */
    1.12 -			msg->FindInt32("dy", &dy) != B_OK    /* y movement */
    1.13 +			msg->FindInt32("x", &x) != B_OK || /* x movement */
    1.14 +			msg->FindInt32("y", &y) != B_OK    /* y movement */
    1.15  		) {
    1.16  			return;
    1.17  		}
    1.18  		win = _GetSDLWindow(winID);
    1.19 -		SDL_SendMouseMotion(win, 0, dx, dy);
    1.20 +		SDL_SendMouseMotion(win, 0, x, y);
    1.21  	}
    1.22  	
    1.23  	void _HandleMouseButton(BMessage *msg) {
     2.1 --- a/src/video/bwindow/SDL_BWin.h	Tue Jul 26 10:13:34 2011 +0000
     2.2 +++ b/src/video/bwindow/SDL_BWin.h	Tue Jul 26 11:38:20 2011 +0000
     2.3 @@ -438,10 +438,9 @@
     2.4      			_MouseFocusEvent(true);
     2.5      		}
     2.6      		BMessage msg(BAPP_MOUSE_MOVED);
     2.7 -    		msg.AddInt32("dx", where.x - x);
     2.8 -    		msg.AddInt32("dy", where.y - y);
     2.9 -    		x = (int) where.x;
    2.10 -    		y = (int) where.y;    		
    2.11 +    		msg.AddInt32("x", (int)where.x);
    2.12 +    		msg.AddInt32("y", (int)where.y);
    2.13 + 		
    2.14      		_PostWindowEvent(msg);
    2.15      	}
    2.16      }
     3.1 --- a/src/video/bwindow/SDL_bmodes.cc	Tue Jul 26 10:13:34 2011 +0000
     3.2 +++ b/src/video/bwindow/SDL_bmodes.cc	Tue Jul 26 11:38:20 2011 +0000
     3.3 @@ -151,7 +151,7 @@
     3.4  }
     3.5  
     3.6  int BE_QuitModes(_THIS) {
     3.7 -	printf(__FILE__": %d; Begin quit\n", __LINE__);
     3.8 +/*	printf(__FILE__": %d; Begin quit\n", __LINE__);*/
     3.9  	/* Restore the previous video mode */
    3.10  	BScreen screen;
    3.11  	display_mode *savedMode = _GetBeApp()->GetPrevMode();