remove unused codes
authorLaurent Mazet <mazet@softndesign.org>
Thu, 17 Oct 2024 06:47:38 +0000 (08:47 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Thu, 17 Oct 2024 06:47:38 +0000 (08:47 +0200)
block.c [deleted file]
block.h [deleted file]
display.c

diff --git a/block.c b/block.c
deleted file mode 100644 (file)
index 9c9fca8..0000000
--- a/block.c
+++ /dev/null
@@ -1,187 +0,0 @@
-#include <curses.h>
-
-#include "block.h"
-
-typedef enum {
-    _black = 0,
-    _blue,
-    _green,
-    _cyan,
-    _red,
-    _magenta,
-    _yellow,
-    _white
-} _color_t;
-
-static int _color_num (int fg, int bg)
-{
-    return (1 << 6) | ((7 & bg) << 3) | (7 & fg);
-}
-static int _color_trans (_color_t c)
-{
-    int color;
-    switch (7 & c) {
-    case _black:
-        color = COLOR_BLACK;
-        break;
-    case _blue:
-        color = COLOR_BLUE;
-        break;
-    case _green:
-        color = COLOR_GREEN;
-        break;
-    case _cyan:
-        color = COLOR_CYAN;
-        break;
-    case _red:
-        color = COLOR_RED;
-        break;
-    case _magenta:
-        color = COLOR_MAGENTA;
-        break;
-    case _yellow:
-        color = COLOR_YELLOW;
-        break;
-    case _white:
-        color = COLOR_WHITE;
-        break;
-    }
-    return color;
-}
-
-static void _init_color_pairs () {
-    int fg, bg;
-    for (bg = 0; bg < 8; bg++) {
-        for (fg = 0; fg < 8; fg ++) {
-            init_pair (_color_num (fg, bg), _color_trans (fg), _color_trans (bg));
-        }
-    }
-}
-
-void mvaddcb (int y, int x, cblock_t color)
-{
-    int init = 1;
-    if (init) {
-        _init_color_pairs ();
-        init = 0;
-    }
-
-    int symb = ACS_CKBOARD;
-    switch (color) {
-    case black:
-    case gray:
-    case blue:
-    case green:
-    case cyan:
-    case red:
-    case magenta:
-    case brown:
-        symb = ' ';
-        break;
-    default:
-        symb = ACS_CKBOARD;
-    }
-
-    int num;
-    switch (color) {
-    case black:
-    case darkgray:
-        num = _color_num (_white, _black);
-        break;
-    case gray:
-    case white:
-        num = _color_num (_white, _white);
-        break;
-    case darkerblue:
-    case darkblue:
-        num = _color_num (_blue, _black);
-        break;
-    case darkergreen:
-    case darkgreen:
-        num = _color_num (_green, _black);
-        break;
-    case darkercyan:
-    case darkcyan:
-        num = _color_num (_cyan, _black);
-        break;
-    case darkerred:
-    case darkred:
-        num = _color_num (_red, _black);
-        break;
-    case darkermagenta:
-    case darkmagenta:
-        num = _color_num (_magenta, _black);
-        break;
-    case darkbrown:
-    case darkeryellow:
-        num = _color_num (_yellow, _black);
-        break;
-    case blue:
-    case lightblue:
-    case lighterblue:
-        num = _color_num (_blue, _white);
-        break;
-    case green:
-    case lightgreen:
-    case lightergreen:
-        num = _color_num (_green, _white);
-        break;
-    case cyan:
-    case lightcyan:
-    case lightercyan:
-        num = _color_num (_cyan, _white);
-        break;
-    case red:
-    case lightred:
-    case lighterred:
-        num = _color_num (_red, _white);
-        break;
-    case magenta:
-    case lightmagenta:
-    case lightermagenta:
-        num = _color_num (_magenta, _white);
-        break;
-    case brown:
-    case darkyellow:
-    case yellow:
-        num = _color_num (_yellow, _white);
-        break;
-    //default:
-    //    num = _color_num (_white, _black);
-    }
-
-    int state;
-    switch (color) {
-    case blue:
-    case green:
-    case cyan:
-    case red:
-    case magenta:
-    case brown:
-        state = A_REVERSE;
-        break;
-    case white:
-    case darkblue:
-    case darkgreen:
-    case darkcyan:
-    case darkred:
-    case darkmagenta:
-    case darkeryellow:
-    case lighterblue:
-    case lightergreen:
-    case lightercyan:
-    case lighterred:
-    case lightermagenta:
-    case yellow:
-        state = A_BOLD;
-        break;
-    default:
-        state = A_NORMAL;
-    }
-
-    attron (COLOR_PAIR (num) | state);
-    mvaddch (y, x, symb);
-    attroff (COLOR_PAIR (num) | state);
-}
-
-/* vim: set ts=4 sw=4 et: */
diff --git a/block.h b/block.h
deleted file mode 100644 (file)
index 481bcc5..0000000
--- a/block.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef __BLOCK_H__
-#define __BLOCK_H__
-
-typedef enum {
-    black,
-    darkgray,
-    gray,
-    white,
-    darkerblue,
-    darkblue,
-    blue,
-    lightblue,
-    lighterblue,
-    darkergreen,
-    darkgreen,
-    green,
-    lightgreen,
-    lightergreen,
-    darkercyan,
-    darkcyan,
-    cyan,
-    lightcyan,
-    lightercyan,
-    darkerred,
-    darkred,
-    red,
-    lightred,
-    lighterred,
-    darkermagenta,
-    darkmagenta,
-    magenta,
-    lightmagenta,
-    lightermagenta,
-    darkbrown,
-    brown,
-    darkeryellow,
-    darkyellow,
-    yellow,
-} cblock_t;
-
-void mvaddcb (int y, int x, cblock_t color);
-
-#endif /* __BLOCK_H__ */
-
-/* vim: set ts=4 sw=4 et: */
index 4cef03a12232a6202c4b2d1886777c4bdc07ca2c..2f02c43ee9aa8a95d5d592079ffa4f7cac970b7b 100644 (file)
--- a/display.c
+++ b/display.c
@@ -3,7 +3,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "block.h"
 #include "color.h"
 #include "debug.h"
 #include "function.h"
@@ -158,8 +157,11 @@ void displayelement (board_t *board, int x, int y)
         break;
     case '.':
         setcolor (yellow_black);
-        //element = ACS_BULLET;
+#ifdef PDCURSES
         element = '.';
+#else
+        element = ACS_BULLET;
+#endif
         break;
     case '*':
         setcolor (yellow_black);