Skip to content

Commit

Permalink
Port mapgen function implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytheway committed Apr 4, 2020
1 parent 9591d1e commit ace1e2e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 39 deletions.
44 changes: 22 additions & 22 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7167,13 +7167,13 @@ void map::create_anomaly( const tripoint &cp, artifact_natural_property prop, bo
}
///////////////////// part of map

void line( map *m, const ter_id &type, int x1, int y1, int x2, int y2 )
void line( map *m, const ter_id &type, const point &p1, const point &p2 )
{
m->draw_line_ter( type, point( x1, y1 ), point( x2, y2 ) );
m->draw_line_ter( type, p1, p2 );
}
void line_furn( map *m, const furn_id &type, int x1, int y1, int x2, int y2 )
void line_furn( map *m, const furn_id &type, const point &p1, const point &p2 )
{
m->draw_line_furn( type, point( x1, y1 ), point( x2, y2 ) );
m->draw_line_furn( type, p1, p2 );
}
void fill_background( map *m, const ter_id &type )
{
Expand All @@ -7183,45 +7183,45 @@ void fill_background( map *m, ter_id( *f )() )
{
m->draw_fill_background( f );
}
void square( map *m, const ter_id &type, int x1, int y1, int x2, int y2 )
void square( map *m, const ter_id &type, const point &p1, const point &p2 )
{
m->draw_square_ter( type, point( x1, y1 ), point( x2, y2 ) );
m->draw_square_ter( type, p1, p2 );
}
void square_furn( map *m, const furn_id &type, int x1, int y1, int x2, int y2 )
void square_furn( map *m, const furn_id &type, const point &p1, const point &p2 )
{
m->draw_square_furn( type, point( x1, y1 ), point( x2, y2 ) );
m->draw_square_furn( type, p1, p2 );
}
void square( map *m, ter_id( *f )(), int x1, int y1, int x2, int y2 )
void square( map *m, ter_id( *f )(), const point &p1, const point &p2 )
{
m->draw_square_ter( f, point( x1, y1 ), point( x2, y2 ) );
m->draw_square_ter( f, p1, p2 );
}
void square( map *m, const weighted_int_list<ter_id> &f, int x1, int y1, int x2, int y2 )
void square( map *m, const weighted_int_list<ter_id> &f, const point &p1, const point &p2 )
{
m->draw_square_ter( f, point( x1, y1 ), point( x2, y2 ) );
m->draw_square_ter( f, p1, p2 );
}
void rough_circle( map *m, const ter_id &type, int x, int y, int rad )
void rough_circle( map *m, const ter_id &type, const point &p, int rad )
{
m->draw_rough_circle_ter( type, point( x, y ), rad );
m->draw_rough_circle_ter( type, p, rad );
}
void rough_circle_furn( map *m, const furn_id &type, int x, int y, int rad )
void rough_circle_furn( map *m, const furn_id &type, const point &p, int rad )
{
m->draw_rough_circle_furn( type, point( x, y ), rad );
m->draw_rough_circle_furn( type, p, rad );
}
void circle( map *m, const ter_id &type, double x, double y, double rad )
{
m->draw_circle_ter( type, rl_vec2d( x, y ), rad );
}
void circle( map *m, const ter_id &type, int x, int y, int rad )
void circle( map *m, const ter_id &type, const point &p, int rad )
{
m->draw_circle_ter( type, point( x, y ), rad );
m->draw_circle_ter( type, p, rad );
}
void circle_furn( map *m, const furn_id &type, int x, int y, int rad )
void circle_furn( map *m, const furn_id &type, const point &p, int rad )
{
m->draw_circle_furn( type, point( x, y ), rad );
m->draw_circle_furn( type, p, rad );
}
void add_corpse( map *m, int x, int y )
void add_corpse( map *m, const point &p )
{
m->add_corpse( tripoint( x, y, m->get_abs_sub().z ) );
m->add_corpse( tripoint( p, m->get_abs_sub().z ) );
}

//////////////////// mapgen update
Expand Down
17 changes: 0 additions & 17 deletions src/mapgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,36 +453,19 @@ enum room_type {
bool connects_to( const oter_id &there, int dir );
void mapgen_rotate( map *m, oter_id terrain_type, bool north_is_down = false );
// wrappers for map:: functions
void line( map *m, const ter_id &type, int x1, int y1, int x2, int y2 );
void line( map *m, const ter_id &type, int x1, int y1, const point &p2 );
void line( map *m, const ter_id &type, const point &p1, const point &p2 );
void line_furn( map *m, const furn_id &type, int x1, int y1, int x2, int y2 );
void line_furn( map *m, const furn_id &type, int x1, int y1, const point &p2 );
void line_furn( map *m, const furn_id &type, const point &p1, const point &p2 );
void fill_background( map *m, const ter_id &type );
void fill_background( map *m, ter_id( *f )() );
void square( map *m, const ter_id &type, int x1, int y1, int x2, int y2 );
void square( map *m, const ter_id &type, int x1, int y1, const point &p2 );
void square( map *m, const ter_id &type, const point &p1, const point &p2 );
void square( map *m, ter_id( *f )(), int x1, int y1, int x2, int y2 );
void square( map *m, ter_id( *f )(), int x1, int y1, const point &p2 );
void square( map *m, ter_id( *f )(), const point &p1, const point &p2 );
void square( map *m, const weighted_int_list<ter_id> &f, int x1, int y1, int x2, int y2 );
void square( map *m, const weighted_int_list<ter_id> &f, int x1, int y1, const point &p2 );
void square( map *m, const weighted_int_list<ter_id> &f, const point &p1, const point &p2 );
void square_furn( map *m, const furn_id &type, int x1, int y1, int x2, int y2 );
void square_furn( map *m, const furn_id &type, int x1, int y1, const point &p2 );
void square_furn( map *m, const furn_id &type, const point &p1, const point &p2 );
void rough_circle( map *m, const ter_id &type, int x, int y, int rad );
void rough_circle( map *m, const ter_id &type, const point &, int rad );
void rough_circle_furn( map *m, const furn_id &type, int x, int y, int rad );
void rough_circle_furn( map *m, const furn_id &type, const point &, int rad );
void circle( map *m, const ter_id &type, double x, double y, double rad );
void circle( map *m, const ter_id &type, int x, int y, int rad );
void circle( map *m, const ter_id &type, const point &, int rad );
void circle_furn( map *m, const furn_id &type, int x, int y, int rad );
void circle_furn( map *m, const furn_id &type, const point &, int rad );
void add_corpse( map *m, int x, int y );
void add_corpse( map *m, const point & );

#endif

0 comments on commit ace1e2e

Please sign in to comment.