1
0
Fork 0

Make centerline light generation more robust for ultra short runways.

This keeps us from generation a bogus output file that could crash fgfs.
This commit is contained in:
curt 2002-11-22 22:00:08 +00:00
parent 585fc97859
commit 58bd28bb03

View file

@ -462,6 +462,9 @@ static superpoly_list gen_runway_center_line_lights( const FGRunway& rwy_info,
dist -= step; dist -= step;
} }
superpoly_list result; result.clear();
if ( w_lights.size() > 0 ) {
FGPolygon lights_poly; lights_poly.erase(); FGPolygon lights_poly; lights_poly.erase();
FGPolygon normals_poly; normals_poly.erase(); FGPolygon normals_poly; normals_poly.erase();
lights_poly.add_contour( w_lights, false ); lights_poly.add_contour( w_lights, false );
@ -472,8 +475,12 @@ static superpoly_list gen_runway_center_line_lights( const FGRunway& rwy_info,
white.set_normals( normals_poly ); white.set_normals( normals_poly );
white.set_material( "RWY_WHITE_MEDIUM_LIGHTS" ); white.set_material( "RWY_WHITE_MEDIUM_LIGHTS" );
lights_poly.erase(); result.push_back( white );
normals_poly.erase(); }
if ( r_lights.size() > 0 ) {
FGPolygon lights_poly; lights_poly.erase();
FGPolygon normals_poly; normals_poly.erase();
lights_poly.add_contour( r_lights, false ); lights_poly.add_contour( r_lights, false );
normals_poly.add_contour( r_normals, false ); normals_poly.add_contour( r_normals, false );
@ -482,10 +489,8 @@ static superpoly_list gen_runway_center_line_lights( const FGRunway& rwy_info,
red.set_normals( normals_poly ); red.set_normals( normals_poly );
red.set_material( "RWY_RED_MEDIUM_LIGHTS" ); red.set_material( "RWY_RED_MEDIUM_LIGHTS" );
superpoly_list result; result.clear();
result.push_back( white );
result.push_back( red ); result.push_back( red );
}
return result; return result;
} }