finish to clean the "show minimap option in lobby"

This commit is contained in:
Ali El Gariani 2007-07-21 13:49:14 +00:00
parent 49e4206b89
commit f920c9eabf
2 changed files with 5 additions and 10 deletions

View file

@ -39,7 +39,7 @@ namespace mp {
observer_icon_locator_("misc/eye.png"), map_hashes_(map_hashes),
item_height_(100), margin_(5), h_padding_(5),
header_height_(20), selected_(0), visible_range_(std::pair<size_t,size_t>(0,0)),
double_clicked_(false), ignore_next_doubleclick_(false), last_was_doubleclick_(false), minimaps_(true)
double_clicked_(false), ignore_next_doubleclick_(false), last_was_doubleclick_(false)
{
set_numeric_keypress_selection(false);
}
@ -107,10 +107,8 @@ void gamebrowser::draw_row(const size_t index, const SDL_Rect& item_rect, ROW_TY
//draw_solid_tinted_rectangle(item_rect.x, item_rect.y, item_rect.w, item_rect.h, 0, 0, 0, 0.2, video().getSurface());
//draw minimaps
if (minimaps_) {
video().blit_surface(xpos, ypos, game.mini_map);
xpos += item_height_ + margin_;
}
video().blit_surface(xpos, ypos, game.mini_map);
xpos += item_height_ + margin_;
//set font color
SDL_Color font_color;
@ -348,15 +346,13 @@ void gamebrowser::set_game_items(const config& cfg, const config& game_config)
if (i->map_id == games_.back().id) {
found = true;
games_.back().map_info_size = i->map_info_size;
if (minimaps_)
games_.back().mini_map = i->mini_map;
games_.back().mini_map = i->mini_map;
}
}
if (!found) {
// parsing the map and generating the minimap are both cpu expensive
gamemap map(game_config, games_.back().map_data);
if (minimaps_)
games_.back().mini_map = image::getMinimap(item_height_ - margin_, item_height_ - 2 * margin_, map, 0);
games_.back().mini_map = image::getMinimap(item_height_ - margin_, item_height_ - 2 * margin_, map, 0);
games_.back().map_info_size = lexical_cast_default<std::string, int>(map.x(), "??") + std::string("x") + lexical_cast_default<std::string, int>(map.y(), "??");
}

View file

@ -87,7 +87,6 @@ private:
bool double_clicked_;
bool ignore_next_doubleclick_;
bool last_was_doubleclick_;
bool minimaps_;
};
class lobby : public ui