diff --git a/src/avatar_action.cpp b/src/avatar_action.cpp index b58f2bd2bd4f7..102be15de50cf 100644 --- a/src/avatar_action.cpp +++ b/src/avatar_action.cpp @@ -90,7 +90,7 @@ static const std::string flag_SWIMMABLE( "SWIMMABLE" ); #define dbg(x) DebugLog((x),D_SDL) << __FILE__ << ":" << __LINE__ << ": " -bool avatar_action::move( avatar &you, map &m, int dx, int dy, int dz ) +bool avatar_action::move( avatar &you, map &m, const tripoint &d ) { if( ( !g->check_safe_mode_allowed() ) || you.has_active_mutation( trait_SHELL2 ) ) { if( you.has_active_mutation( trait_SHELL2 ) ) { @@ -100,14 +100,14 @@ bool avatar_action::move( avatar &you, map &m, int dx, int dy, int dz ) } const bool is_riding = you.is_mounted(); tripoint dest_loc; - if( dz == 0 && you.has_effect( effect_stunned ) ) { + if( d.z == 0 && you.has_effect( effect_stunned ) ) { dest_loc.x = rng( you.posx() - 1, you.posx() + 1 ); dest_loc.y = rng( you.posy() - 1, you.posy() + 1 ); dest_loc.z = you.posz(); } else { - dest_loc.x = you.posx() + dx; - dest_loc.y = you.posy() + dy; - dest_loc.z = you.posz() + dz; + dest_loc.x = you.posx() + d.x; + dest_loc.y = you.posy() + d.y; + dest_loc.z = you.posz() + d.z; } if( dest_loc == you.pos() ) { @@ -215,7 +215,7 @@ bool avatar_action::move( avatar &you, map &m, int dx, int dy, int dz ) } } - if( dz == 0 && ramp_move( you, m, dest_loc ) ) { + if( d.z == 0 && ramp_move( you, m, dest_loc ) ) { // TODO: Make it work nice with automove (if it doesn't do so already?) return false; } diff --git a/src/avatar_action.h b/src/avatar_action.h index 75c6c4816b8ad..cb13230763b68 100644 --- a/src/avatar_action.h +++ b/src/avatar_action.h @@ -24,11 +24,7 @@ bool eat_here( avatar &you ); // Standard movement; handles attacks, traps, &c. Returns false if auto move // should be canceled -bool move( avatar &you, map &m, int dx, int dy, int dz = 0 ); -inline bool move( avatar &you, map &m, const tripoint &d ) -{ - return move( you, m, d.x, d.y, d.z ); -} +bool move( avatar &you, map &m, const tripoint &d ); inline bool move( avatar &you, map &m, const point &d ) { return move( you, m, tripoint( d, 0 ) ); diff --git a/src/construction.cpp b/src/construction.cpp index f2bae9c10390f..6a4fd67914cb5 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -1591,11 +1591,11 @@ void check_constructions() } } -int construction::print_time( const catacurses::window &w, int ypos, int xpos, int width, +int construction::print_time( const catacurses::window &w, const point &p, int width, nc_color col ) const { std::string text = get_time_string(); - return fold_and_print( w, point( xpos, ypos ), width, col, text ); + return fold_and_print( w, p, width, col, text ); } float construction::time_scale() const diff --git a/src/construction.h b/src/construction.h index 413914f6a43b6..22a820c721182 100644 --- a/src/construction.h +++ b/src/construction.h @@ -94,7 +94,6 @@ struct construction { // NPC assistance adjusted int adjusted_time() const; - int print_time( const catacurses::window &w, int ypos, int xpos, int width, nc_color col ) const; int print_time( const catacurses::window &w, const point &, int width, nc_color col ) const; std::vector get_folded_time_string( int width ) const; // Result of construction scaling option diff --git a/src/panels.cpp b/src/panels.cpp index 90af024341f3c..c5a23387a2a48 100644 --- a/src/panels.cpp +++ b/src/panels.cpp @@ -207,15 +207,15 @@ std::string window_panel::get_name() const } void overmap_ui::draw_overmap_chunk( const catacurses::window &w_minimap, const avatar &you, - const tripoint &global_omt, const int start_y_input, const int start_x_input, const int width, - const int height ) + const tripoint &global_omt, const point &start_input, + const int width, const int height ) { const int cursx = global_omt.x; const int cursy = global_omt.y; const tripoint targ = you.get_active_mission_target(); bool drew_mission = targ == overmap::invalid_tripoint; - const int start_y = start_y_input + ( height / 2 ) - 2; - const int start_x = start_x_input + ( width / 2 ) - 2; + const int start_y = start_input.y + ( height / 2 ) - 2; + const int start_x = start_input.x + ( width / 2 ) - 2; for( int i = -( width / 2 ); i <= width - ( width / 2 ) - 1; i++ ) { for( int j = -( height / 2 ); j <= height - ( height / 2 ) - 1; j++ ) { @@ -410,7 +410,7 @@ void overmap_ui::draw_overmap_chunk( const catacurses::window &w_minimap, const static void draw_minimap( const avatar &u, const catacurses::window &w_minimap ) { const tripoint curs = u.global_omt_location(); - overmap_ui::draw_overmap_chunk( w_minimap, u, curs, 0, 0, 5, 5 ); + overmap_ui::draw_overmap_chunk( w_minimap, u, curs, point_zero, 5, 5 ); } static void decorate_panel( const std::string &name, const catacurses::window &w ) @@ -1370,7 +1370,7 @@ static void draw_loc_labels( const avatar &u, const catacurses::window &w, bool if( minimap ) { const int offset = getmaxx( w ) - 6; const tripoint curs = u.global_omt_location(); - overmap_ui::draw_overmap_chunk( w, u, curs, -1, offset, 5, 5 ); + overmap_ui::draw_overmap_chunk( w, u, curs, point( offset, -1 ), 5, 5 ); } wrefresh( w ); } diff --git a/src/panels.h b/src/panels.h index 2acdc3a5fbc2d..3e77b25b06409 100644 --- a/src/panels.h +++ b/src/panels.h @@ -29,9 +29,6 @@ enum face_type : int { namespace overmap_ui { -void draw_overmap_chunk( const catacurses::window &w_minimap, const avatar &you, - const tripoint &global_omt, int start_y, int start_x, int width, - int height ); void draw_overmap_chunk( const catacurses::window &w_minimap, const avatar &you, const tripoint &global_omt, const point &start, int width, int height ); diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index dc90209346b4b..9ec4c0bf64a99 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -467,7 +467,7 @@ const std::string &string_input_popup::query_string( const bool loop, const bool return _text; } -string_input_popup &string_input_popup::window( const catacurses::window &w, int startx, int starty, +string_input_popup &string_input_popup::window( const catacurses::window &w, const point &start, int endx ) { if( !custom_window && this->w ) { @@ -475,8 +475,8 @@ string_input_popup &string_input_popup::window( const catacurses::window &w, int return *this; } this->w = w; - _startx = startx; - _starty = starty; + _startx = start.x; + _starty = start.y; _endx = endx; custom_window = true; return *this; diff --git a/src/string_input_popup.h b/src/string_input_popup.h index 059ecdaab0a7d..2a3be4cd0a996 100644 --- a/src/string_input_popup.h +++ b/src/string_input_popup.h @@ -174,7 +174,6 @@ class string_input_popup // NOLINT(cata-xy) * This method only has effect before the default window is initialized. * After that calls to this method are just ignored. */ - string_input_popup &window( const catacurses::window &w, int startx, int starty, int endx ); string_input_popup &window( const catacurses::window &w, const point &start, int endx ); /** * Set / get the input context that is used to gather user input.