📄 paint.c
字号:
#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 ;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -