| Revision: | 1.3 |
| Committed: | Mon Oct 25 12:06:57 2010 UTC (15 years, 11 months ago) by sf-pippijn |
| Content type: | text/plain |
| Branch: | MAIN |
| CVS Tags: | HEAD |
| Changes since 1.2: | +1 -1 lines |
| Log Message: | be more strict about the protocol |
| # | Content |
|---|---|
| 1 | void |
| 2 | command_parser::on_map_scroll (std::istream &args) |
| 3 | { |
| 4 | int dx, dy; |
| 5 | args >> dx >> dy; |
| 6 | PARSE_END; |
| 7 | |
| 8 | 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 | map.x += dx; |
| 19 | map.y += dy; |
| 20 | |
| 21 | emit map_scroll (dx, dy); |
| 22 | } |