summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tileweb.h
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-08-26 22:50:06 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-08-26 23:06:30 +0200
commit770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch)
treee030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/tileweb.h
parenta6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff)
downloadcrawl-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/tileweb.h')
-rw-r--r--crawl-ref/source/tileweb.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/crawl-ref/source/tileweb.h b/crawl-ref/source/tileweb.h
index 670cfad63c..2f635051a9 100644
--- a/crawl-ref/source/tileweb.h
+++ b/crawl-ref/source/tileweb.h
@@ -58,7 +58,7 @@ public:
void place_cursor(cursor_type type, const coord_def &gc);
void clear_text_tags(text_tag_type type);
- void add_text_tag(text_tag_type type, const std::string &tag,
+ void add_text_tag(text_tag_type type, const string &tag,
const coord_def &gc);
void add_text_tag(text_tag_type type, const monster_info& mon);
@@ -76,7 +76,7 @@ public:
void clear_to_end_of_line();
void push_menu(Menu* m);
- void push_crt_menu(std::string tag);
+ void push_crt_menu(string tag);
void pop_menu();
void close_all_menus();
@@ -113,24 +113,24 @@ public:
data is sent until pop_prefix is called. The suffix
passed to pop_prefix will only be sent if the prefix
was sent. */
- void push_prefix(const std::string& prefix);
- void pop_prefix(const std::string& suffix);
+ void push_prefix(const string& prefix);
+ void pop_prefix(const string& suffix);
bool prefix_popped();
// Helper functions for writing JSON
- void write_message_escaped(const std::string& s);
- void json_open_object(const std::string& name = "");
+ void write_message_escaped(const string& s);
+ void json_open_object(const string& name = "");
void json_close_object();
- void json_open_array(const std::string& name = "");
+ void json_open_array(const string& name = "");
void json_close_array();
void json_write_comma();
- void json_write_name(const std::string& name);
+ void json_write_name(const string& name);
void json_write_int(int value);
- void json_write_int(const std::string& name, int value);
- void json_write_string(const std::string& value);
- void json_write_string(const std::string& name, const std::string& value);
+ void json_write_int(const string& name, int value);
+ void json_write_string(const string& value);
+ void json_write_string(const string& name, const string& value);
- std::string m_sock_name;
+ string m_sock_name;
bool m_await_connection;
WebtilesCRTMode m_crt_mode;
@@ -143,25 +143,25 @@ public:
protected:
int m_sock;
int m_max_msg_size;
- std::string m_msg_buf;
- std::vector<sockaddr_un> m_dest_addrs;
+ string m_msg_buf;
+ vector<sockaddr_un> m_dest_addrs;
bool m_controlled_from_web;
void _await_connection();
- wint_t _handle_control_message(sockaddr_un addr, std::string data);
+ wint_t _handle_control_message(sockaddr_un addr, string data);
wint_t _receive_control_message();
- std::vector<std::string> m_prefixes;
+ vector<string> m_prefixes;
int json_object_level;
bool need_comma;
struct MenuInfo
{
- std::string tag;
+ string tag;
Menu* menu;
};
- std::vector<MenuInfo> m_menu_stack;
+ vector<MenuInfo> m_menu_stack;
WebtilesUIState m_ui_state;
@@ -180,8 +180,8 @@ protected:
coord_def m_next_view_tl;
coord_def m_next_view_br;
- std::bitset<GXM * GYM> m_dirty_cells;
- std::bitset<GXM * GYM> m_cells_needing_redraw;
+ bitset<GXM * GYM> m_dirty_cells;
+ bitset<GXM * GYM> m_cells_needing_redraw;
void mark_for_redraw(const coord_def& gc);
void mark_dirty(const coord_def& gc);
void mark_clean(const coord_def& gc);
@@ -192,7 +192,7 @@ protected:
int m_next_flash_colour;
FixedArray<map_cell, GXM, GYM> m_current_map_knowledge;
- std::map<uint32_t, coord_def> m_monster_locs;
+ map<uint32_t, coord_def> m_monster_locs;
bool m_need_full_map;
coord_def m_cursor[CURSOR_MAX];
@@ -221,10 +221,10 @@ protected:
void _send_cell(const coord_def &gc,
const screen_cell_t &current_sc, const screen_cell_t &next_sc,
const map_cell &current_mc, const map_cell &next_mc,
- std::map<uint32_t, coord_def>& new_monster_locs,
+ map<uint32_t, coord_def>& new_monster_locs,
bool force_full);
void _send_monster(const coord_def &gc, const monster_info* m,
- std::map<uint32_t, coord_def>& new_monster_locs,
+ map<uint32_t, coord_def>& new_monster_locs,
bool force_full);
};
@@ -241,7 +241,7 @@ public:
}
tiles_crt_control(WebtilesCRTMode mode,
- std::string tag = "")
+ string tag = "")
: m_old_mode(tiles.m_crt_mode)
{
tiles.m_crt_mode = mode;