On Tue, 22 Jul 2003 18:46:14 -0500
"Curtis L. Olson" <[EMAIL PROTECTED]> wrote:
> Update of /var/cvs/FlightGear-0.9/source/src/Network
> In directory baron:/tmp/cvs-serv19507/Network
>
> Modified Files:
> native_fdm.cxx net_fdm.hxx
> Log Message:
> Add gear animation effects to replay.
>
>
> Index: native_fdm.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/Network/native_fdm.cxx,v
> retrieving revision 1.12
> retrieving revision 1.13
> diff -C2 -r1.12 -r1.13
> *** native_fdm.cxx 22 Jul 2003 20:05:38 -0000 1.12
> --- native_fdm.cxx 22 Jul 2003 23:46:11 -0000 1.13
> ***************
> *** 184,187 ****
> --- 184,190 ----
> SGPropertyNode *node = fgGetNode("/gear/gear", i, true);
> net->wow[i] = node->getDoubleValue("wow");
> + net->gear_pos[i] = node->getDoubleValue("position-norm");
> + net->gear_steer[i] = node->getDoubleValue("steering-norm");
> + net->gear_compression[i] =
> node->getDoubleValue("compression-norm");
> }
>
> ***************
> *** 247,250 ****
> --- 250,256 ----
> for ( i = 0; i < net->num_wheels; ++i ) {
> net->wow[i] = htonl(net->wow[i]);
> + net->gear_pos[i] = htonl(net->gear_pos[i]);
> + net->gear_steer[i] = htonl(net->gear_steer[i]);
> + net->gear_compression[i] = htonl(net->gear_compression[i]);
> }
> net->num_wheels = htonl(net->num_wheels);
> ***************
These latest changes generate a compilation error:
native_fdm.cxx: In function `void FGProps2NetFDM(FGNetFDM*, bool)':
native_fdm.cxx:252: invalid operands of types `float' and `unsigned int' to
binary `operator&'
The gear_* members should be converted using htonf() instead of htonl().
A minor nit with htonf() is that it doesn't return the converted value like
the other htonX functions. For consistency I wonder if we should change
this.
Cheers,
Bernie
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel