X-Git-Url: http://git.shiar.net/netris.git/blobdiff_plain/ec797c133bd83404f6167fb46c098c236333d168..776faa936ea4b3f5ccaacda0f05a2ed1e945d304:/board.c diff --git a/board.c b/board.c index 125cdd0..245cea1 100644 --- a/board.c +++ b/board.c @@ -1,6 +1,6 @@ /* * Netris -- A free networked version of T*tris - * Copyright (C) 1994,1995,1996 Mark H. Weaver + * Copyright (C) 1994-1996,1999 Mark H. Weaver * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: board.c,v 1.14 1996/02/09 08:22:08 mhw Exp $ + * $Id: board.c,v 1.15 1999/05/16 06:56:24 mhw Exp $ */ #include "netris.h" @@ -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; } @@ -237,7 +244,7 @@ ExtFunc void InsertJunk(int scr, int count, int column) CopyLine(scr, y, y + count); for (y = 0; y < count; ++y) for (x = 0; x < boardWidth[scr]; ++x) - SetBlock(scr, y, x, (x == column) ? BT_none : BT_piece1); + SetBlock(scr, y, x, (x == column) ? BT_none : BT_white); curY[scr] += count; }