summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/message.h
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-07 12:24:40 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-07 12:24:40 +0000
commit80efbb31cad981ef99a5526b895a040fb930d46a (patch)
treefa3b5327e7760c45c71fdaaa85ceba5dc34e8785 /crawl-ref/source/message.h
parent05982cef94ba574904072aada7d1cfadca06f5e0 (diff)
downloadcrawl-ref-80efbb31cad981ef99a5526b895a040fb930d46a.tar.gz
crawl-ref-80efbb31cad981ef99a5526b895a040fb930d46a.zip
Messaging improvements.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1411 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/message.h')
-rw-r--r--crawl-ref/source/message.h83
1 files changed, 40 insertions, 43 deletions
diff --git a/crawl-ref/source/message.h b/crawl-ref/source/message.h
index 96a2094f40..a5e3385bc3 100644
--- a/crawl-ref/source/message.h
+++ b/crawl-ref/source/message.h
@@ -78,26 +78,12 @@ private:
bool msuppressed;
};
-// last updated 12may2000 {dlb}
-/* ***********************************************************************
- * called from: acr
- * *********************************************************************** */
-void replay_messages(void);
+bool any_messages();
+void replay_messages();
-
-// last updated 12may2000 {dlb}
-/* ***********************************************************************
- * called from: acr - it_use3 - items - religion
- * *********************************************************************** */
void set_colour(char set_message_colour);
-// last updated 18mar2001 {dlb}
-/* ***********************************************************************
- * called from: acr
- * *********************************************************************** */
-bool any_messages(void);
-
// last updated 13oct2003 {dlb}
/* ***********************************************************************
* called from: chardump
@@ -106,34 +92,45 @@ std::string get_last_messages(int mcount);
int channel_to_colour( int channel, int param = 0 );
-struct setchan
+namespace msg
{
- setchan(msg_channel_type chan);
- msg_channel_type m_chan;
-};
-
-struct setparam
-{
- setparam(int param);
- int m_param;
-};
-
-std::ostream& operator<<(std::ostream& os, const setchan& sc);
-std::ostream& operator<<(std::ostream& os, const setparam& sp);
-
-class mpr_stream_buf : public std::streambuf
-{
-public:
- mpr_stream_buf();
-protected:
- int overflow(int c);
-private:
- static const int INTERNAL_LENGTH = 500;
- char internal_buf[500]; // if your terminal is wider than this, too bad
- int internal_count;
-};
-
-extern std::ostream mpr_stream;
+ extern std::ostream stream;
+ std::ostream& streams(msg_channel_type chan = MSGCH_PLAIN);
+
+ struct setparam
+ {
+ setparam(int param);
+ int m_param;
+ };
+
+ struct mute
+ {
+ mute(bool value = true);
+ bool m_value;
+ };
+
+ class mpr_stream_buf : public std::streambuf
+ {
+ public:
+ mpr_stream_buf(msg_channel_type chan);
+ void set_param(int p);
+ void set_muted(bool m);
+ protected:
+ int overflow(int c);
+ private:
+ static const int INTERNAL_LENGTH = 500;
+ char internal_buf[500]; // if your terminal is wider than this, too bad
+ int internal_count;
+ int param;
+ bool muted;
+ msg_channel_type channel;
+ };
+
+ void initialise_mpr_streams();
+ void deinitalise_mpr_streams();
+}
+
+std::ostream& operator<<(std::ostream& os, const msg::setparam& sp);
#endif