commentary++

Tue, 30 Jul 2013 17:38:29 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 30 Jul 2013 17:38:29 +0300
changeset 405
b8c813906ac0
parent 404
902f137ea753
child 406
5371baa17346

commentary++

src/messagelog.h file | annotate | diff | comparison | revisions
--- a/src/messagelog.h	Tue Jul 30 17:27:04 2013 +0300
+++ b/src/messagelog.h	Tue Jul 30 17:38:29 2013 +0300
@@ -26,14 +26,24 @@
 
 class GLRenderer;
 class QTimer;
-class MessageManager : public QObject
-{
+
+/* The message manager is an object which keeps track of messages that appear
+ * on the renderer's screen. Each line is contained in a separate object which
+ * contains the text, expiry time and alpha. The message manager is doubly
+ * linked to its corresponding renderer.
+ *
+ * Message manager calls its tick() function regularly to update the messages,
+ * where each line's expiry is checked for. Lines begin to fade out when nearing
+ * their expiry. If the message manager's lines change, the renderer undergoes
+ * repainting.
+ */
+class MessageManager : public QObject {
 	Q_OBJECT
 	PROPERTY( GLRenderer*, renderer, setRenderer )
 	
 public:
-	class Line
-	{
+	// Single line of the message log.
+	class Line {
 	public:
 		Line( str text );
 		bool update( bool& changed );

mercurial