MCPcopy Create free account
hub / github.com/diasurgical/devilution / scrollrt_draw

Function scrollrt_draw

Source/scrollrt.cpp:766–792  ·  view source on GitHub ↗

* @brief Render a row of tile * @param x dPiece coordinate * @param y dPiece coordinate * @param sx Back buffer coordinate * @param sy Back buffer coordinate * @param chunks tile width of row * @param row current row being rendered */

Source from the content-addressed store, hash-verified

764 * @param row current row being rendered
765 */
766static void scrollrt_draw(int x, int y, int sx, int sy, int chunks, int row)
767{
768 assert(gpBuffer);
769
770 if (row & 1) {
771 x -= 1;
772 y += 1;
773 sx -= 32;
774 chunks += 1;
775 }
776
777 for (int j = 0; j < chunks; j++) {
778 if (y >= 0 && y < MAXDUNY && x >= 0 && x < MAXDUNX) {
779 level_piece_id = dPiece[x][y];
780 if (level_piece_id != 0) {
781 drawRow(x, y, sx, sy, 1);
782 } else {
783 world_draw_black_tile(sx, sy);
784 }
785 } else {
786 world_draw_black_tile(sx, sy);
787 }
788 x++;
789 y--;
790 sx += 64;
791 }
792}
793
794/**
795 * @brief Configure render and process screen rows

Callers 1

DrawGameFunction · 0.85

Calls 2

drawRowFunction · 0.85
world_draw_black_tileFunction · 0.85

Tested by

no test coverage detected