Melchior  FRANZ writes:
> 
> Index: input.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Input/input.cxx,v
> retrieving revision 1.23
> diff -u -p -r1.23 input.cxx
> --- input.cxx   4 Jun 2003 11:27:41 -0000       1.23
> +++ input.cxx   4 Jun 2003 11:41:28 -0000
> @@ -699,7 +699,7 @@ FGInput::_update_joystick (double dt)
>    float axis_values[MAX_JOYSTICK_AXES];
> 
>    // update the joystick 20 times per second.
> -  if ((_last_dt += dt) > 50)
> +  if ((_last_dt += dt) > 0.05)
>      _last_dt = 0.0;
>    else
>      return;

FWIW 
I would actually use something like

_last_dt += dt;
if (_last_dt > 0.05)
{
    while(_last_dt >= 0.05)
        _last_dt -= 0.05;
} else {
    return
}

The compiler doesn't need the += inside the if statement
with any optimization flag and keep the partial

Cheers

Norman


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to