| 2868 | } |
| 2869 | |
| 2870 | static command_result CopyScreen(color_ostream &stream, const EmptyMessage *in, ScreenCapture *out) |
| 2871 | { |
| 2872 | df::graphic * gps = df::global::gps; |
| 2873 | out->set_width(gps->dimx); |
| 2874 | out->set_height(gps->dimy); |
| 2875 | for (int i = 0; i < (gps->dimx * gps->dimy); i++) |
| 2876 | { |
| 2877 | int index = i * 4; |
| 2878 | auto tile = out->add_tiles(); |
| 2879 | tile->set_character(gps->screen[index]); |
| 2880 | tile->set_foreground(gps->screen[index + 1] | (gps->screen[index + 3] * 8)); |
| 2881 | tile->set_background(gps->screen[index + 2]); |
| 2882 | } |
| 2883 | |
| 2884 | return CR_OK; |
| 2885 | } |
| 2886 | |
| 2887 | static command_result PassKeyboardEvent(color_ostream &stream, const KeyboardEvent *in) |
| 2888 | { |