#include "libepc.h" #include "tetris.h" #define BLOCK 0xDB /* ------------------------------------------------------------ */ /* Paints the tetris object whose upper left corner is at row, */ /* col, with rotation rot, using color clr. If on is TRUE, it */ /* paints the object; if on is FALSE, it erases the object. */ /* ------------------------------------------------------------ */ void PaintObject(int row, int col, int rot, BOOL on, char clr) { WORD16 cell ; int r ; cell = on ? CELL(BLOCK, clr) : EMPTY ; for (r = 0; r < 2; r++) { int c ; for (c = 0; c < 4; c++) { if (!On(rot, r, c)) continue ; *Cell(row + r, col + c) = cell ; } } }