ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/src/frontend/client/renderer.cpp
Revision: 1.5
Committed: Sun Oct 24 20:31:53 2010 UTC (16 years ago) by sf-pippijn
Branch: MAIN
Changes since 1.4: +2 -2 lines
Log Message:
use EV and plain sockets instead of asio

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 drawinfo (level, channel + ": " + msg);
43 }
44
45 void
46 renderer::stats (data::statistics const &stats)
47 {
48 ui.stats->update (stats);
49 ui.stats->visualize ();
50 }