X-Git-Url: http://git.shiar.net/netris.git/blobdiff_plain/968bf843bad5fc3d0c2d96a26fc39f3f01d94bfc..776faa936ea4b3f5ccaacda0f05a2ed1e945d304:/board.c diff --git a/board.c b/board.c index d1cb66b..245cea1 100644 --- a/board.c +++ b/board.c @@ -104,6 +104,12 @@ ExtFunc int RefreshBoard(int scr) return any; } +ExtFunc int GlanceFunc(int scr, int y, int x, BlockType type, void *data) +{ + PlotBlock1(scr, y, x, type); + return 0; +} + ExtFunc int PlotFunc(int scr, int y, int x, BlockType type, void *data) { SetBlock(scr, y, x, type); @@ -161,14 +167,15 @@ ExtFunc int MovePiece(int scr, int deltaY, int deltaX) return result; } -ExtFunc int RotatePiece(int scr) +ExtFunc int RotatePiece(int scr, int dir) { int result; EraseShape(curShape[scr], scr, curY[scr], curX[scr]); - result = ShapeFits(curShape[scr]->rotateTo, scr, curY[scr], curX[scr]); + result = ShapeFits(dir ? curShape[scr]->rotateTo : curShape[scr]->rotateFrom, + scr, curY[scr], curX[scr]); if (result) - curShape[scr] = curShape[scr]->rotateTo; + curShape[scr] = dir ? curShape[scr]->rotateTo : curShape[scr]->rotateFrom; PlotShape(curShape[scr], scr, curY[scr], curX[scr], 1); return result; }