1
0
Fork 0

The island mask should actually contain islands, not water.

This commit is contained in:
Ralf Gerlich 2010-01-19 19:39:28 +01:00
parent 69eb4be737
commit 3a83772a09
3 changed files with 9 additions and 2 deletions

View file

@ -471,7 +471,7 @@ bool TGClipper::clip_all(const point2d& min, const point2d& max) {
water_mask = water_mask =
tgPolygonUnion( water_mask, polys_in.polys[i][j] ); tgPolygonUnion( water_mask, polys_in.polys[i][j] );
} }
} else if ( is_water_area( i ) ) { } else if ( is_island_area( i ) ) {
for (unsigned int j = 0; j < polys_in.polys[i].size(); j++) { for (unsigned int j = 0; j < polys_in.polys[i].size(); j++) {
island_mask = island_mask =
tgPolygonUnion( island_mask, polys_in.polys[i][j] ); tgPolygonUnion( island_mask, polys_in.polys[i][j] );

View file

@ -149,7 +149,13 @@ bool is_water_area( AreaType area ) {
} }
bool is_landmass_area( AreaType area ) { bool is_landmass_area( AreaType area ) {
return get_area_descriptor( area ).kind==Landmass; const AreaKind kind = get_area_descriptor( area ).kind;
return (kind==Landmass);
}
bool is_island_area( AreaType area ) {
const AreaKind kind = get_area_descriptor( area ).kind;
return (kind==Island);
} }
bool is_lake_area( AreaType area ) { bool is_lake_area( AreaType area ) {

View file

@ -33,6 +33,7 @@ typedef unsigned int AreaType;
int load_area_types( const std::string& filename ); int load_area_types( const std::string& filename );
bool is_hole_area(AreaType areaType); bool is_hole_area(AreaType areaType);
bool is_landmass_area(AreaType areaType); bool is_landmass_area(AreaType areaType);
bool is_island_area(AreaType areaType);
bool is_water_area(AreaType areaType); bool is_water_area(AreaType areaType);
bool is_lake_area(AreaType areaType); bool is_lake_area(AreaType areaType);
bool is_stream_area(AreaType areaType); bool is_stream_area(AreaType areaType);