ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/src/backend/communicator/command_parser/fx.h
Revision: 1.1
Committed: Sun Oct 17 08:15:03 2010 UTC (16 years ago) by sf-pippijn
Content type: text/plain
Branch: MAIN
Log Message:
initial import

File Contents

# User Rev Content
1 sf-pippijn 1.1 #include "deliantra/data/fx.h"
2     #include "deliantra/data/glyph.h"
3    
4     void
5     command_parser::on_fx (std::istream &args)
6     {
7     std::vector<data::fx> faces;
8    
9     u32 type = 0;
10     while (args.peek () != EOF)
11     {
12     u32 facenum = read_ber32 (args);
13     std::string name = read_string08 (args);
14    
15     if (facenum)
16     {
17     data::glyph glyph;
18     if (!name.empty ())
19     {
20     glyph.fg = name[0];
21     glyph.bg = name[1];
22     glyph.text = name.substr (2);
23     }
24     else
25     glyph.text = " ";
26     data::register_glyph (facenum, glyph);
27     faces.emplace_back (data::fx { type, facenum, name });
28     }
29     else if (name.length () == 1)
30     type = name[0];
31     }
32    
33     emit fx (faces);
34     }