gem: revert back to graf_mkstate usage to get mouse state SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sun, 04 Nov 2012 19:07:49 +0100
branchSDL-1.2
changeset 66491aab0b09a0e3
parent 6648 5415ef59343a
child 6855 dbaee3350e32
gem: revert back to graf_mkstate usage to get mouse state
src/video/gem/SDL_gemevents.c
     1.1 --- a/src/video/gem/SDL_gemevents.c	Sun Nov 04 19:02:21 2012 +0100
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Sun Nov 04 19:07:49 2012 +0100
     1.3 @@ -87,25 +87,22 @@
     1.4  		quit = 0;
     1.5  
     1.6  		resultat = evnt_multi(
     1.7 -			MU_MESAG|MU_TIMER|MU_KEYBD|MU_BUTTON|MU_M1,
     1.8 -			0x101,7,prevmb,
     1.9 -			MO_LEAVE,prevmx,prevmy,1,1,
    1.10 +			MU_MESAG|MU_TIMER|MU_KEYBD,
    1.11 +			0,0,0,
    1.12 +			0,0,0,0,0,
    1.13  			0,0,0,0,0,
    1.14  			buffer,
    1.15  			10,
    1.16 -			&mousex,&mousey,&mouseb,&kstate,&kc,&dummy
    1.17 +			&dummy,&dummy,&dummy,&kstate,&kc,&dummy
    1.18  		);
    1.19  
    1.20  		/* Message event ? */
    1.21  		if (resultat & MU_MESAG)
    1.22  			quit = do_messages(this, buffer);
    1.23  
    1.24 -		/* Special keys ? */
    1.25 -		if (resultat & (MU_KEYBD|MU_BUTTON))
    1.26 -			do_keyboard_special(kstate);
    1.27 -
    1.28  		/* Keyboard event ? */
    1.29  		if (resultat & MU_KEYBD) {
    1.30 +			do_keyboard_special(kstate);
    1.31  			if (prevkc != kc) {
    1.32  				do_keyboard(kc);
    1.33  				prevkc = kc;
    1.34 @@ -115,24 +112,17 @@
    1.35  			}
    1.36  		}
    1.37  
    1.38 -		/* Mouse motion event ? */
    1.39 -		if (resultat & MU_M1) {
    1.40 -			do_mouse_motion(this, mousex, mousey);
    1.41 -			prevmx = mousex;
    1.42 -			prevmy = mousey;
    1.43 -		}
    1.44 -
    1.45 -		/* Mouse button event ? */
    1.46 -		if (resultat & MU_BUTTON) {
    1.47 -			do_mouse_buttons(this, mouseb);
    1.48 -			prevmb = mouseb & 7;
    1.49 -		}
    1.50 -
    1.51  		/* Timer event ? */
    1.52  		if ((resultat & MU_TIMER) || quit)
    1.53  			break;
    1.54  	}
    1.55  
    1.56 +	/* Update mouse state */
    1.57 +	graf_mkstate(&mousex, &mousey, &mouseb, &kstate);
    1.58 +	do_keyboard_special(kstate);
    1.59 +	do_mouse_motion(this, mousex, mousey);
    1.60 +	do_mouse_buttons(this, mouseb);
    1.61 +
    1.62  	/* Now generate keyboard events */
    1.63  	for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
    1.64  		/* Key pressed ? */