-/* $NetBSD: tetris.h,v 1.8 2000/01/01 10:15:17 jsm Exp $ */
+/* $NetBSD: tetris.h,v 1.16 2020/07/21 02:42:05 nia Exp $ */
/*-
* Copyright (c) 1992, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#define MINCOLS 40
extern int Rows, Cols; /* current screen size */
+extern int Offset; /* vert. offset to center board */
/*
* Translations from board coordinates to display coordinates.
* rotated forms.
*/
struct shape {
+ int color;
int rot; /* index of rotated version of this shape */
int off[3]; /* offsets to other blots if center is at (0,0) */
};
extern const struct shape shapes[];
-#define randshape() (&shapes[random() % 7])
+#define randshape() (&shapes[arc4random_uniform(7)])
-extern const struct shape *curshape;
extern const struct shape *nextshape;
/*
extern char key_msg[100];
extern int showpreview;
+extern int nocolor;
-int fits_in __P((const struct shape *, int));
-void place __P((const struct shape *, int, int));
-void stop __P((const char *)) __attribute__((__noreturn__));
+int fits_in(const struct shape *, int);
+void place(const struct shape *, int, int);
+void stop(const char *) __dead;