X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=ansitris;a=blobdiff_plain;f=src%2Fpieces.h;h=90be0a03fbac14e716bf78802dba967f48c8e2a9;hp=de396ec0b8b9c5e0c3863dc1194b896300804ec5;hb=HEAD;hpb=f71c261ce691d78fccb3f377ae5299edbf0e0062 diff --git a/src/pieces.h b/src/pieces.h index de396ec..90be0a0 100644 --- a/src/pieces.h +++ b/src/pieces.h @@ -2,8 +2,12 @@ #define PIECES_H_ #define BLK(x, y) ((x) | ((y) << 4)) +#define BLKX(c) ((unsigned char)(c) & 0xf) +#define BLKY(c) ((unsigned char)(c) >> 4) -unsigned char pieces[][4][4] = { +#define NUM_PIECES 7 + +static unsigned char pieces[NUM_PIECES][4][4] = { /* straight piece */ { {BLK(0, 2), BLK(1, 2), BLK(2, 2), BLK(3, 2)}, @@ -55,5 +59,9 @@ unsigned char pieces[][4][4] = { } }; +static int piece_spawnpos[NUM_PIECES][2] = { + {-2, -2}, {-1, -2}, {-1, -2}, {-1, -2}, {-1, -2}, {-1, -2}, {-1, -2} +}; + #endif /* PIECES_H_ */