Game Display: clean up unused/unnecessary functions

Removed:
- debug_highlight et al. Unused, and we have the main "display coordinates" debug flag in the base class
- current_team_name. Only used in one place, clearer to just call team_name directly.
- get_terrain_on. Unimplemented
This commit is contained in:
Charles Dang 2024-10-18 14:19:37 -04:00
parent a80831fb9f
commit fc514ccefb
3 changed files with 3 additions and 39 deletions

View file

@ -50,8 +50,6 @@ static lg::log_domain log_display("display");
static lg::log_domain log_engine("engine");
#define ERR_NG LOG_STREAM(err, log_engine)
std::map<map_location, int> game_display::debugHighlights_;
/**
* Function to return 2 half-hex footsteps images for the given location.
* Only loc is on the current route set by set_route.
@ -325,14 +323,6 @@ void game_display::draw_hex(const map_location& loc)
if(!is_shrouded && on_map) {
draw_movement_info(loc);
}
if(game_config::debug) {
int debugH = debugHighlights_[loc];
if (debugH) {
std::string txt = std::to_string(debugH);
draw_text_in_hex(loc, drawing_layer::move_info, txt, 18, font::BAD_COLOR);
}
}
}
const time_of_day& game_display::get_time_of_day(const map_location& loc) const
@ -601,12 +591,6 @@ void game_display::float_label(const map_location& loc, const std::string& text,
font::add_floating_label(flabel);
}
int& game_display::debug_highlight(const map_location& loc)
{
assert(game_config::debug);
return debugHighlights_[loc];
}
void game_display::set_attack_indicator(const map_location& src, const map_location& dst)
{
if (attack_indicator_src_ != src || attack_indicator_dst_ != dst) {
@ -626,11 +610,6 @@ void game_display::clear_attack_indicator()
set_attack_indicator(map_location::null_location(), map_location::null_location());
}
std::string game_display::current_team_name() const
{
return viewing_team().team_name();
}
void game_display::begin_game()
{
in_game_ = true;

View file

@ -187,21 +187,8 @@ public:
attack_indicator_src_.get_relative_dir(attack_indicator_dst_));
}
// Functions used in the editor:
//void draw_terrain_palette(int x, int y, terrain_type::TERRAIN selected);
t_translation::terrain_code get_terrain_on(int palx, int paly, int x, int y);
virtual const map_location &displayed_unit_hex() const override { return displayedUnitHex_; }
/**
* annotate hex with number, useful for debugging or UI prototype
*/
static int& debug_highlight(const map_location& loc);
static void clear_debug_highlights() { debugHighlights_.clear(); }
std::string current_team_name() const;
display_chat_manager & get_chat_manager() { return *chat_man_; }
void begin_game();
@ -248,9 +235,6 @@ private:
game_mode mode_;
// For debug mode
static std::map<map_location, int> debugHighlights_;
bool needs_rebuild_;
};

View file

@ -838,8 +838,9 @@ void menu_handler::clear_labels()
);
if(res == gui2::retval::OK) {
gui_->labels().clear(gui_->current_team_name(), false);
resources::recorder->clear_labels(gui_->current_team_name(), false);
std::string viewing_team = gui_->viewing_team().team_name();
gui_->labels().clear(viewing_team, false);
resources::recorder->clear_labels(viewing_team, false);
}
}
}