78 piecec = piece == PAWN ? 'P' : getpiecechr(piece); |
79 piecec = piece == PAWN ? 'P' : getpiecechr(piece); |
79 } else { |
80 } else { |
80 piecec = ' '; |
81 piecec = ' '; |
81 } |
82 } |
82 |
83 |
83 attrset((col == WHITE ? A_BOLD : A_DIM) | |
84 _Bool boardblack = (y&1)==(x&1); |
84 COLOR_PAIR((y&1)==(x&1) ? COL_WB : COL_BW)); |
85 attrset((col==WHITE ? A_BOLD : A_DIM)| |
|
86 COLOR_PAIR(col == WHITE ? |
|
87 (boardblack ? COL_WB : COL_WW) : |
|
88 (boardblack ? COL_BB : COL_BW) |
|
89 ) |
|
90 ); |
85 |
91 |
86 int cy = gamestate->mycolor == WHITE ? boardy-y : boardy-7+y; |
92 int cy = gamestate->mycolor == WHITE ? boardy-y : boardy-7+y; |
87 int cx = gamestate->mycolor == WHITE ? boardx+x*3 : boardx+21-x*3; |
93 int cx = gamestate->mycolor == WHITE ? boardx+x*3 : boardx+21-x*3; |
88 mvaddch(cy, cx, ' '); |
94 mvaddch(cy, cx, ' '); |
89 mvaddch(cy, cx+1, piecec); |
95 mvaddch(cy, cx+1, piecec); |
431 gamestate_cleanup(&gamestate); |
437 gamestate_cleanup(&gamestate); |
432 |
438 |
433 mvaddstr(getmaxy(stdscr)-1, 0, |
439 mvaddstr(getmaxy(stdscr)-1, 0, |
434 "Game has ended. Press any key to leave..."); |
440 "Game has ended. Press any key to leave..."); |
435 refresh(); |
441 refresh(); |
|
442 cbreak(); |
|
443 flushinp(); |
436 getch(); |
444 getch(); |
437 } |
445 } |
438 |
446 |
439 void game_start(Settings *settings, int opponent) { |
447 void game_start(Settings *settings, int opponent) { |
440 inputy = getmaxy(stdscr) - 6; |
448 inputy = getmaxy(stdscr) - 6; |