diff options
author | Bardur Arantsson <bardur@scientician.net> | 2017-06-13 18:24:42 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2017-06-13 18:24:42 +0200 |
commit | 554ff9a63d5d9bc64f668a00b6baa9b91dc41306 (patch) | |
tree | 6d25a4f53042a4f4154d07fa77921c0ba13b68bd /src/util.cc | |
parent | 0595b2fa946619d29624505f8edc0f9c00146e61 (diff) |
Move "messages" to Game struct
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/util.cc b/src/util.cc index 9190f4a1..9005c04f 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1758,15 +1758,15 @@ void display_message(int x, int y, int split, byte color, cptr t) */ void cmsg_print(byte color, cptr msg) { - static int p = 0; + auto &messages = game->messages; - int n; - int wid; + static int p = 0; char *t; char buf[1024]; + int wid; Term_get_size(&wid, nullptr); int lim = wid - 8; @@ -1774,7 +1774,7 @@ void cmsg_print(byte color, cptr msg) if (!msg_flag) p = 0; /* Message Length */ - n = (msg ? strlen(msg) : 0); + int n = (msg ? strlen(msg) : 0); /* Hack -- flush when requested or needed */ if (p && (!msg || ((p + n) > lim))) @@ -1798,7 +1798,10 @@ void cmsg_print(byte color, cptr msg) /* Memorize the message */ - if (character_generated) message_add(msg, color); + if (character_generated) + { + messages.add(msg, color); + } /* Handle "auto_more" */ if (options->auto_more) @@ -1867,9 +1870,6 @@ void cmsg_print(byte color, cptr msg) /* Display the tail of the message */ display_message(p, 0, n, color, t); - /* Memorize the tail */ - /* if (character_generated) message_add(t); */ - /* Window stuff */ if (p_ptr) { |