ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/src/frontend/client/renderer.cpp
Revision: 1.6
Committed: Sun Feb 6 21:54:06 2011 UTC (15 years, 8 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +5 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #include "dclient/renderer.h"
2 #include "dclient/render_glyph.h"
3 #include "dclient/widgets.h"
4 #include "dclient/widgets/map.h"
5 #include "dclient/widgets/stats.h"
6
7 #include "deliantra/data/map.h"
8 #include "deliantra/data/statistics.h"
9
10 #include <ndk/application.hh>
11 #include <ndk/color.hh>
12
13 renderer::renderer (widgets &ui)
14 : ui (ui)
15 {
16 }
17
18 renderer::~renderer ()
19 {
20 }
21
22 void
23 renderer::drawinfo (int level, std::string const &info)
24 {
25 ui.info->add_text (ndi_color (level & NDI_COLOR_MASK, 0), info + "\n");
26 ui.info->visualize ();
27 }
28
29 void
30 renderer::map (data::map const &map)
31 {
32 ui.map->update (map);
33 ui.map->visualize ();
34 ui.stats->visualize ();
35
36 ndk::app->update ();
37 }
38
39 void
40 renderer::msg (int level, std::string const &channel, std::string const &msg)
41 {
42 // check for special types indicated by level
43 // TEMPORARY WORKAROUND //
44 if (level == 255)
45 return;
46 // END //
47 drawinfo (level, channel + ": " + msg);
48 }
49
50 void
51 renderer::stats (data::statistics const &stats)
52 {
53 ui.stats->update (stats);
54 ui.stats->visualize ();
55 }