initial interface requests
[netris.git] / board.c
diff --git a/board.c b/board.c
index d1cb66bb2b12caadc07fa176a788e5e1dc245012..245cea1d43eb6194f697f82c8488a840f0d59864 100644 (file)
--- 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;
 }