diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 22:50:06 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 23:06:30 +0200 |
commit | 770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch) | |
tree | e030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/tilesdl.cc | |
parent | a6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff) | |
download | crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.tar.gz crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.zip |
Use std namespace.
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 36ed43998e..6851a72062 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -191,7 +191,7 @@ void TilesFramework::draw_title() * open while the title screen shows, the .at(0) will need * to be changed and saved on a variable somewhere instead */ -void TilesFramework::update_title_msg(std::string message) +void TilesFramework::update_title_msg(string message) { ASSERT(m_layers[LAYER_TILE_CONTROL].m_regions.size() == 1); ASSERT(m_active_layer == LAYER_TILE_CONTROL); @@ -285,7 +285,7 @@ bool TilesFramework::initialise() "dat/tiles/stone_soup_icon-32x32.png"; #endif - std::string title = CRAWL " " + Version::Long(); + string title = CRAWL " " + Version::Long(); // Do our initialization here. @@ -527,7 +527,7 @@ int TilesFramework::getch_ck() wm->set_timer(res, &_timer_callback); m_tooltip.clear(); - std::string prev_alt = m_region_msg->alt_text(); + string prev_alt = m_region_msg->alt_text(); m_region_msg->alt_text().clear(); if (need_redraw()) @@ -803,14 +803,14 @@ void TilesFramework::do_layout() // Then, the optimal situation without the overlay - we can fit both // Options.view_max_height and at least Options.msg_min_height in the space. - if (std::max(Options.view_max_height, ENV_SHOW_DIAMETER) + if (max(Options.view_max_height, ENV_SHOW_DIAMETER) * m_region_tile->dy + Options.msg_min_height * m_region_msg->dy <= m_windowsz.y && !message_overlay) { - message_y_divider = std::max(Options.view_max_height, ENV_SHOW_DIAMETER) + message_y_divider = max(Options.view_max_height, ENV_SHOW_DIAMETER) * m_region_tile->dy; - message_y_divider = std::max(message_y_divider, m_windowsz.y - + message_y_divider = max(message_y_divider, m_windowsz.y - Options.msg_max_height * m_region_msg->dy); } else @@ -891,7 +891,7 @@ void TilesFramework::autosize_minimap() const int vert = (m_statcol_bottom - (m_region_map->sy ? m_region_map->sy : m_statcol_top) - map_margin * 2) / GYM; - m_region_map->dx = m_region_map->dy = std::min(horiz, vert); + m_region_map->dx = m_region_map->dy = min(horiz, vert); } void TilesFramework::place_minimap() @@ -959,8 +959,8 @@ void TilesFramework::place_tab(int idx) break; } - int lines = std::min(max_ln, (m_statcol_bottom - m_statcol_top - m_tab_margin) - / m_region_tab->dy); + int lines = min(max_ln, (m_statcol_bottom - m_statcol_top - m_tab_margin) + / m_region_tab->dy); if (lines >= min_ln) { TabbedRegion* region_tab = new TabbedRegion(m_init); @@ -981,8 +981,8 @@ void TilesFramework::place_tab(int idx) void TilesFramework::resize_inventory() { - int lines = std::min(max_inv_height - min_inv_height, - (m_statcol_bottom - m_statcol_top) / m_region_tab->dy); + int lines = min(max_inv_height - min_inv_height, + (m_statcol_bottom - m_statcol_top) / m_region_tab->dy); if (lines == 0) return; @@ -1044,7 +1044,7 @@ void TilesFramework::layout_statcol() for (int i = 0, size = Options.tile_layout_priority.size(); i < size; ++i) { - std::string str = Options.tile_layout_priority[i]; + string str = Options.tile_layout_priority[i]; if (str == "inventory") resize_inventory(); else if (str == "minimap" || str == "map") @@ -1231,7 +1231,7 @@ void TilesFramework::clear_text_tags(text_tag_type type) m_region_tile->clear_text_tags(type); } -void TilesFramework::add_text_tag(text_tag_type type, const std::string &tag, +void TilesFramework::add_text_tag(text_tag_type type, const string &tag, const coord_def &gc) { m_region_tile->add_text_tag(type, tag, gc); |