diff options
-rw-r--r-- | src/util.cc | 22 | ||||
-rw-r--r-- | src/util.hpp | 2 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/util.cc b/src/util.cc index 027c6c80..ce791015 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1976,29 +1976,25 @@ void cmsg_format(byte color, cptr fmt, ...) cmsg_print(color, buf); } - - -/* -* Display a string on the screen using an attribute. -* -* At the given location, using the given attribute, if allowed, -* add the given string. Do not clear the line. -*/ void c_put_str(byte attr, cptr str, int row, int col) { - /* Position cursor, Dump the attr/text */ Term_putstr(col, row, -1, attr, str); } -/* -* As above, but in "white" -*/ +void c_put_str(byte attr, std::string const &str, int row, int col) +{ + Term_putstr(col, row, -1, attr, str.c_str()); +} + void put_str(cptr str, int row, int col) { - /* Spawn */ Term_putstr(col, row, -1, TERM_WHITE, str); } +void put_str(std::string const &str, int row, int col) +{ + Term_putstr(col, row, -1, TERM_WHITE, str.c_str()); +} /* diff --git a/src/util.hpp b/src/util.hpp index 4c74ad10..cc896e69 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -41,7 +41,9 @@ extern void msg_format(cptr fmt, ...); extern void screen_save(void); extern void screen_load(void); extern void c_put_str(byte attr, cptr str, int row, int col); +extern void c_put_str(byte attr, std::string const &str, int row, int col); extern void put_str(cptr str, int row, int col); +extern void put_str(std::string const &s, int row, int col); extern void c_prt(byte attr, cptr str, int row, int col); extern void c_prt(byte attr, std::string const &s, int row, int col); extern void prt(std::string const &s, int row, int col); |