Tetris is tilted on displays with both height < 16 and height < width

This commit is contained in:
Christian Kroll 2014-05-25 18:12:12 +02:00
parent 720d547f4a
commit f0fdc0521e
1 changed files with 13 additions and 2 deletions

View File

@ -52,8 +52,14 @@
/** color of line counter */
#define TETRIS_VIEW_COLORCOUNTER 2
#if (NUM_ROWS < 16) && (NUM_COLS > NUM_ROWS) && (!defined GAME_TETRIS_FP)
# define VIEWCOLS NUM_ROWS
# define VIEWROWS NUM_COLS
# define VIEW_TILT
#else
# define VIEWCOLS NUM_COLS
# define VIEWROWS NUM_ROWS
#endif
#if VIEWROWS >= 20
#define TETRIS_VIEW_YOFFSET_DUMP ((VIEWROWS - 20) / 2)
@ -112,6 +118,11 @@ static void tetris_view_setpixel(tetris_bearing_t nBearing,
uint8_t y,
uint8_t nColor)
{
#ifdef VIEW_TILT
// tilt counter clockwise
nBearing = (nBearing + 3) % 4u;
#endif
x = VIEWCOLS - 1 - x;
pixel px;