X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=ansitris;a=blobdiff_plain;f=src%2Fpieces.h;h=e3a5c54c2e4ccfd1b157689add478fee5b954b8a;hp=de396ec0b8b9c5e0c3863dc1194b896300804ec5;hb=bbe47075b6b56c7c6eb14b968a72cfb79d55d7bc;hpb=0bdf1f5608fc18fe9d999bd400e951df9342c831 diff --git a/src/pieces.h b/src/pieces.h index de396ec..e3a5c54 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] = { + {-1, -2}, {-1, -3}, {-1, -2}, {-1, -2}, {-1, -2}, {-1, -2}, {-1, -2} +}; + #endif /* PIECES_H_ */