diff --git a/client/climisc.cpp b/client/climisc.cpp index d4130f0d61..a9ab21eed0 100644 --- a/client/climisc.cpp +++ b/client/climisc.cpp @@ -99,7 +99,6 @@ void client_remove_unit(struct unit *punit) if (old > 0 && get_num_units_in_focus() == 0) { unit_focus_advance(); } else if (update) { - update_unit_pix_label(get_units_in_focus()); update_unit_info_label(get_units_in_focus()); } diff --git a/client/control.cpp b/client/control.cpp index 933d1ad04b..2b33acacf0 100644 --- a/client/control.cpp +++ b/client/control.cpp @@ -68,9 +68,6 @@ static int disband_unit_alternatives[3] = { ACTION_HELP_WONDER, }; -// gui-dep code may adjust depending on tile size etc: -int num_units_below = MAX_NUM_UNITS_BELOW; - // current_focus points to the current unit(s) in focus static auto current_focus = std::vector(); @@ -902,65 +899,6 @@ int blink_turn_done_button() return blink_time; } -/** - Update unit icons (and arrow) in the information display, for specified - punit as the active unit and other units on the same square. In practice - punit is almost always (or maybe strictly always?) the focus unit. - - Static vars store some info on current (ie previous) state, to avoid - unnecessary redraws; initialise to "flag" values to always redraw first - time. In principle we _might_ need more info (eg ai.control, connecting), - but in practice this is enough? - - Used to store unit_ids for below units, to use for callbacks (now done - inside gui-dep set_unit_icon()), but even with ids here they would not - be enough information to know whether to redraw -- instead redraw every - time. (Could store enough info to know, but is it worth it?) - */ -void update_unit_pix_label(const std::vector &units) -{ - int i; - - /* Check for any change in the unit's state. This assumes that a unit's - * orders cannot be changed directly but must be removed and then reset. */ - if (!units.empty() && C_S_OVER != client_state()) { - /* There used to be a complicated and bug-prone check here to see if - * the unit had actually changed. This was misguided since the stacked - * units (below) are redrawn in any case. Unless we write a general - * system for unit updates here we might as well just redraw it every - * time. */ - struct unit *punit = units.front(); - - set_unit_icon(-1, punit); - - i = 0; // index into unit_below_canvas - unit_list_iterate(unit_tile(punit)->units, aunit) - { - if (aunit != punit) { - if (i < num_units_below) { - set_unit_icon(i, aunit); - } - i++; - } - } - unit_list_iterate_end; - - if (i > num_units_below) { - set_unit_icons_more_arrow(true); - } else { - set_unit_icons_more_arrow(false); - for (; i < num_units_below; i++) { - set_unit_icon(i, nullptr); - } - } - } else { - for (i = -1; i < num_units_below; i++) { - set_unit_icon(i, nullptr); - } - set_unit_icons_more_arrow(false); - } -} - /** Adjusts way combatants are displayed suitable for combat. */ diff --git a/client/control.h b/client/control.h index 8a42d76b1f..8e61eb9dd0 100644 --- a/client/control.h +++ b/client/control.h @@ -157,8 +157,6 @@ void unit_focus_update(); void set_auto_center_enabled(bool enabled); void auto_center_on_focus_unit(); -void update_unit_pix_label(const std::vector &units); - unit *find_visible_unit(const ::tile *ptile); void set_units_in_combat(struct unit *pattacker, struct unit *pdefender); int blink_active_unit(); @@ -213,8 +211,3 @@ void key_unit_wakeup_others(); void finish_city(struct tile *ptile, const char *name); void cancel_city(struct tile *ptile); - -/* don't change this unless you also put more entries in data/Freeciv */ -#define MAX_NUM_UNITS_BELOW 4 - -extern int num_units_below; diff --git a/client/gui_main.cpp b/client/gui_main.cpp index 907c15b113..ac7bea0f66 100644 --- a/client/gui_main.cpp +++ b/client/gui_main.cpp @@ -146,32 +146,6 @@ void sound_bell() */ void add_net_input(QIODevice *sock) { king()->add_server_source(sock); } -/** - Set one of the unit icons (specified by idx) in the information area - based on punit. - - punit is the unit the information should be taken from. Use nullptr to - clear the icon. - - idx specified which icon should be modified. Use idx == -1 to indicate - the icon for the active unit. Or idx in [0..num_units_below-1] for - secondary (inactive) units on the same tile. - */ -void set_unit_icon(int idx, struct unit *punit) -{ // PORTME -} - -/** - Most clients use an arrow (e.g., sprites.right_arrow) to indicate when - the units_below will not fit. This function is called to activate or - deactivate the arrow. - - Is disabled by default. - */ -void set_unit_icons_more_arrow(bool onoff) -{ // PORTME -} - /** Called when the set of units in focus (get_units_in_focus()) changes. Standard updates like update_unit_info_label() are handled in the diff --git a/client/qtg_cxxside.h b/client/qtg_cxxside.h index 8518a731f9..7e6e500431 100644 --- a/client/qtg_cxxside.h +++ b/client/qtg_cxxside.h @@ -29,8 +29,6 @@ client_pages get_current_client_page(); void popup_combat_info(int attacker_unit_id, int defender_unit_id, int attacker_hp, int defender_hp, bool make_att_veteran, bool make_def_veteran); -void set_unit_icon(int idx, unit *punit); -void set_unit_icons_more_arrow(bool onoff); void real_focus_units_changed(); void gui_update_font(const QString &font_name, const QFont &font_value);