From f65ab6eeba1593d00f2fd569aee2e1a72a86b926 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Sun, 18 May 2014 02:10:07 +0200 Subject: [PATCH] First Person Tetris: trigger compile time error on non-square displays --- src/games/tetris/variant_fp.c | 3 +++ src/games/tetris/view.c | 19 ++----------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/games/tetris/variant_fp.c b/src/games/tetris/variant_fp.c index 1410485..16ea462 100644 --- a/src/games/tetris/variant_fp.c +++ b/src/games/tetris/variant_fp.c @@ -32,6 +32,9 @@ #include "variant_std.h" #include "variant_fp.h" +#if (NUM_ROWS != NUM_COLS) + #error "First Person Tetris does not support non-square displays!" +#endif /*************** * entry point * diff --git a/src/games/tetris/view.c b/src/games/tetris/view.c index 71340b9..ba542d6 100644 --- a/src/games/tetris/view.c +++ b/src/games/tetris/view.c @@ -52,23 +52,8 @@ /** color of line counter */ #define TETRIS_VIEW_COLORCOUNTER 2 - -#ifdef GAME_TETRIS_FP - #if NUM_ROWS < NUM_COLS - #define VIEWCOLS NUM_ROWS - #define VIEWROWS NUM_ROWS - #elif NUM_ROWS > NUM_COLS - #define VIEWCOLS NUM_COLS - #define VIEWROWS NUM_COLS - #else - #define VIEWCOLS NUM_COLS - #define VIEWROWS NUM_ROWS - #endif -#else - #define VIEWCOLS NUM_COLS - #define VIEWROWS NUM_ROWS -#endif - +#define VIEWCOLS NUM_COLS +#define VIEWROWS NUM_ROWS #if VIEWROWS >= 20 #define TETRIS_VIEW_YOFFSET_DUMP ((VIEWROWS - 20) / 2)