git.shiar.nl
/
netris.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
initial interface requests
[netris.git]
/
board.c
diff --git
a/board.c
b/board.c
index 125cdd0000768d3e519b9a34d4b07bd49fc7f194..245cea1d43eb6194f697f82c8488a840f0d59864 100644
(file)
--- a/
board.c
+++ b/
board.c
@@
-1,6
+1,6
@@
/*
* Netris -- A free networked version of T*tris
/*
* 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
*
* 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.
*
* 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.1
4 1996/02/09 08:22:08
mhw Exp $
+ * $Id: board.c,v 1.1
5 1999/05/16 06:56:24
mhw Exp $
*/
#include "netris.h"
*/
#include "netris.h"
@@
-104,6
+104,12
@@
ExtFunc int RefreshBoard(int scr)
return any;
}
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);
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;
}
return result;
}
-ExtFunc int RotatePiece(int scr)
+ExtFunc int RotatePiece(int scr
, int dir
)
{
int result;
EraseShape(curShape[scr], scr, curY[scr], curX[scr]);
{
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)
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;
}
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)
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;
}
curY[scr] += count;
}