/*
* Netris -- A free networked version of T*tris
- * Copyright (C) 1994,1995,1996 Mark H. Weaver <mhw@netris.org>
+ * Copyright (C) 1994-1996,1999 Mark H. Weaver <mhw@netris.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* 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"
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);
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;
}
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;
}