OK, the line of code causing the frame rate hit was the following:

if((fabs(xyp.y() - xyc.y()) < ((runway.length/2.0) + 5.0)) 
        && (fabs(xyp.x() - xyc.x()) < (runway.width/2.0))) {
        return(true);
}
return false;

To simplify things, I broke it down into a few more lines:
        
double rlen = runway.length/2.0 + 5.0;
double rwidth = runway.width/2.0;
double ldiff = fabs(xyp.y() - xyc.y());
double wdiff = fabs(xyp.x() - xyc.x());
return((ldiff < rlen) && (wdiff < rwidth));

whereupon I found it was the last of those lines that caused the hit.

Replacing the offending line:

return((ldiff < rlen) && (wdiff < rwidth));

with the somewhat more verbose

if(ldiff < rlen) {
        return(wdiff < rwidth);
} else {
        return(false);
}

cures it completely!  Am I doing something really daft, or is this a
genuine compiler bug?

Cheers - Dave
        



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

Reply via email to