MCPcopy Create free account
hub / github.com/DFHack/dfhack / CopyScreen

Function CopyScreen

plugins/remotefortressreader/remotefortressreader.cpp:2870–2885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2868}
2869
2870static 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
2887static command_result PassKeyboardEvent(color_ostream &stream, const KeyboardEvent *in)
2888{

Callers

nothing calls this directly

Calls 1

add_tilesMethod · 0.80

Tested by

no test coverage detected