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

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