ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/src/backend/communicator/command_parser/map_scroll.h
Revision: 1.2
Committed: Wed Oct 20 08:33:41 2010 UTC (16 years ago) by sf-pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.1: +10 -0 lines
Log Message:
2 glyphs / map space

File Contents

# User Rev Content
1 sf-pippijn 1.1 void
2     command_parser::on_map_scroll (std::istream &args)
3     {
4     int dx, dy;
5     args >> dx >> dy;
6     assert (args.peek () == EOF);
7    
8 sf-pippijn 1.2 if (dx > 0)
9     map.blank (map.x , map.y , dx , map.h);
10     else if (dx < 0)
11     map.blank (map.x + map.w + dx, map.y , -dx , map.h);
12    
13     if (dy > 0)
14     map.blank (map.x , map.y , map.w, dy);
15     else if (dy < 0)
16     map.blank (map.x , map.y + map.h + dy, map.w, -dy);
17    
18 sf-pippijn 1.1 map.x += dx;
19     map.y += dy;
20    
21     emit map_scroll (dx, dy);
22     }