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:
parent
585fc97859
commit
58bd28bb03
1 changed files with 27 additions and 22 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue