src/events/SDL_mouse.c
changeset 1525 23a347cfbed8
parent 1442 e3242177fe4a
child 1662 782fd950bd46
child 1895 c121d94672cb
child 4159 a1b03ba2fcd0
     1.1 --- a/src/events/SDL_mouse.c	Tue Mar 14 05:34:39 2006 +0000
     1.2 +++ b/src/events/SDL_mouse.c	Tue Mar 14 06:00:30 2006 +0000
     1.3 @@ -30,8 +30,8 @@
     1.4  
     1.5  
     1.6  /* These are static for our mouse handling code */
     1.7 -static Sint16 SDL_MouseX = -1;
     1.8 -static Sint16 SDL_MouseY = -1;
     1.9 +static Sint16 SDL_MouseX = 0;
    1.10 +static Sint16 SDL_MouseY = 0;
    1.11  static Sint16 SDL_DeltaX = 0;
    1.12  static Sint16 SDL_DeltaY = 0;
    1.13  static Uint8  SDL_ButtonState = 0;
    1.14 @@ -41,8 +41,8 @@
    1.15  int SDL_MouseInit(void)
    1.16  {
    1.17  	/* The mouse is at (0,0) */
    1.18 -	SDL_MouseX = -1;
    1.19 -	SDL_MouseY = -1;
    1.20 +	SDL_MouseX = 0;
    1.21 +	SDL_MouseY = 0;
    1.22  	SDL_DeltaX = 0;
    1.23  	SDL_DeltaY = 0;
    1.24  	SDL_ButtonState = 0;
    1.25 @@ -68,18 +68,10 @@
    1.26  Uint8 SDL_GetMouseState (int *x, int *y)
    1.27  {
    1.28  	if ( x ) {
    1.29 -		if ( SDL_MouseX < 0 ) {
    1.30 -			*x = 0;
    1.31 -		} else {
    1.32 -			*x = SDL_MouseX;
    1.33 -		}
    1.34 +		*x = SDL_MouseX;
    1.35  	}
    1.36  	if ( y ) {
    1.37 -		if ( SDL_MouseY < 0 ) {
    1.38 -			*y = 0;
    1.39 -		} else {
    1.40 -			*y = SDL_MouseY;
    1.41 -		}
    1.42 +		*y = SDL_MouseY;
    1.43  	}
    1.44  	return(SDL_ButtonState);
    1.45  }
    1.46 @@ -157,7 +149,7 @@
    1.47  	   This prevents lots of extraneous large delta relative motion when
    1.48  	   the screen is windowed mode and the mouse is outside the window.
    1.49  	*/
    1.50 -	if ( ! relative && SDL_MouseX >= 0 && SDL_MouseY >= 0 ) {
    1.51 +	if ( ! relative ) {
    1.52  		Xrel = X-SDL_MouseX;
    1.53  		Yrel = Y-SDL_MouseY;
    1.54  	}