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,30 +462,35 @@ static superpoly_list gen_runway_center_line_lights( const FGRunway& rwy_info,
|
||||||
dist -= step;
|
dist -= step;
|
||||||
}
|
}
|
||||||
|
|
||||||
FGPolygon lights_poly; lights_poly.erase();
|
|
||||||
FGPolygon normals_poly; normals_poly.erase();
|
|
||||||
lights_poly.add_contour( w_lights, false );
|
|
||||||
normals_poly.add_contour( w_normals, false );
|
|
||||||
|
|
||||||
FGSuperPoly white;
|
|
||||||
white.set_poly( lights_poly );
|
|
||||||
white.set_normals( normals_poly );
|
|
||||||
white.set_material( "RWY_WHITE_MEDIUM_LIGHTS" );
|
|
||||||
|
|
||||||
lights_poly.erase();
|
|
||||||
normals_poly.erase();
|
|
||||||
lights_poly.add_contour( r_lights, false );
|
|
||||||
normals_poly.add_contour( r_normals, false );
|
|
||||||
|
|
||||||
FGSuperPoly red;
|
|
||||||
red.set_poly( lights_poly );
|
|
||||||
red.set_normals( normals_poly );
|
|
||||||
red.set_material( "RWY_RED_MEDIUM_LIGHTS" );
|
|
||||||
|
|
||||||
superpoly_list result; result.clear();
|
superpoly_list result; result.clear();
|
||||||
|
|
||||||
result.push_back( white );
|
if ( w_lights.size() > 0 ) {
|
||||||
result.push_back( red );
|
FGPolygon lights_poly; lights_poly.erase();
|
||||||
|
FGPolygon normals_poly; normals_poly.erase();
|
||||||
|
lights_poly.add_contour( w_lights, false );
|
||||||
|
normals_poly.add_contour( w_normals, false );
|
||||||
|
|
||||||
|
FGSuperPoly white;
|
||||||
|
white.set_poly( lights_poly );
|
||||||
|
white.set_normals( normals_poly );
|
||||||
|
white.set_material( "RWY_WHITE_MEDIUM_LIGHTS" );
|
||||||
|
|
||||||
|
result.push_back( white );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( r_lights.size() > 0 ) {
|
||||||
|
FGPolygon lights_poly; lights_poly.erase();
|
||||||
|
FGPolygon normals_poly; normals_poly.erase();
|
||||||
|
lights_poly.add_contour( r_lights, false );
|
||||||
|
normals_poly.add_contour( r_normals, false );
|
||||||
|
|
||||||
|
FGSuperPoly red;
|
||||||
|
red.set_poly( lights_poly );
|
||||||
|
red.set_normals( normals_poly );
|
||||||
|
red.set_material( "RWY_RED_MEDIUM_LIGHTS" );
|
||||||
|
|
||||||
|
result.push_back( red );
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue