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

Method draw

library/modules/Screen.cpp:710–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708}
709
710void PenArray::draw(unsigned int x, unsigned int y, unsigned int width, unsigned int height,
711 unsigned int bufx, unsigned int bufy)
712{
713 if (!gps)
714 return;
715 for (unsigned int gridx = x; gridx < x + width; gridx++)
716 {
717 for (unsigned int gridy = y; gridy < y + height; gridy++)
718 {
719 if (gridx >= unsigned(gps->dimx) ||
720 gridy >= unsigned(gps->dimy) ||
721 gridx - x + bufx >= dimx ||
722 gridy - y + bufy >= dimy)
723 continue;
724 Screen::paintTile(buffer[((gridy - y + bufy) * dimx) + (gridx - x + bufx)], gridx, gridy);
725 }
726 }
727}
728
729/*
730 * Base DFHack viewscreen.

Callers 1

dfhack_penarray_drawFunction · 0.45

Calls 1

paintTileFunction · 0.85

Tested by

no test coverage detected