Re: [AD] About Javier Gonzalez's patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


George Foot wrote:
> 
> I'm not sure what you mean by this; I don't think it's
> possible to be totally consistent. 

I mean that, Allegro mouse speed and range being set, the actual behaviour of
the mouse (in terms of speed, acceleration, sensitivity, ...) should be roughly
the same, whatever platform you're using.


> Don't the sizes of mickeys vary according to the mouse?

Probably, but maybe can we suppose that it's only by a small amount for the most
common mice ? (for a given platform, of course)


> So in DOS the screen resolution doesn't
> affect the mouse sensitivity -- I don't think the low level
> mouse drivers change their sensitivity when you change the
> range, but if they do then this would affect the non-mickey DOS
> mouse drivers.

I did some tests and I think you're right.


> Linux Allegro currently reads raw mouse data, in all variants of
> the driver, so it's basically mickeys.  It doesn't take any
> notice of the screen resolution.

But you coded the following function in lmouse.c:

/* __al_linux_mouse_set_speed:
 *  Sets the speed of the mickey-mode mouse.
 */
void __al_linux_mouse_set_speed(int xspeed, int yspeed)
{
   int scale;

   if (gfx_driver)
      scale = 256*gfx_driver->w/320;
   else
      scale = 256;

   DISABLE();

   mouse_sx = scale / MAX(1, xspeed);
   mouse_sy = scale / MAX(1, yspeed);

   mouse_mx = COORD_TO_MICKEY_X(_mouse_x);
   mouse_my = COORD_TO_MICKEY_Y(_mouse_y);

   ENABLE();
}

Is the function unused ?


> The X mouse driver ..., so if the application stops doing game-type
> reading and starts doing GUI-type reading the pointer will
> change to the better system for that.

Clever.


> So in the X mouse driver the sensitivity in Allegro
> automatically matches the sensitivity in X in general, and it's
> possible that the screen resolution is taken into account by X.

I was thinking of X when I posted my previous message.


> Generally I think mickey systems shouldn't use the screen
> resolution, because the idea of reading mickeys is that you're
> not just moving a pointer around.  If you're directly
> controlling a character in a game (e.g. a 3D first person game)
> you tend to want the same mouse motion to give the same result,
> no matter what the screen resolution is.  Also, the danger with
> using screen resolutions is that you'll make a system which
> can't click on all the pixels in high resolution modes.

You're obviously right; and Javier's patch fits perfectly with this viewpoint. 
Thanks for your explanations.

-- 
Eric Botcazou (ebotcazou@xxxxxxxxxx)
Web site: http://www.multimania.com/ebotcazou



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/