| 277 |
277 |
| 278 return 0; |
278 return 0; |
| 279 } |
279 } |
| 280 |
280 |
| 281 static void draw_board(GameState *gamestate, uint8_t perspective) { |
281 static void draw_board(GameState *gamestate, uint8_t perspective) { |
| 282 char fen[90]; |
282 char fen[FEN_MAX_LENGTH]; |
| 283 fen_compute(fen, gamestate); |
283 fen_compute(fen, gamestate); |
| 284 mvaddstr(0, 0, fen); |
284 mvaddstr(0, 0, fen); |
| 285 |
285 |
| 286 for (uint8_t y = 0 ; y < 8 ; y++) { |
286 for (uint8_t y = 0 ; y < 8 ; y++) { |
| 287 for (uint8_t x = 0 ; x < 8 ; x++) { |
287 for (uint8_t x = 0 ; x < 8 ; x++) { |
| 932 uint8_t mycolor = gamestate->info.servercolor; |
932 uint8_t mycolor = gamestate->info.servercolor; |
| 933 if (as_client) { |
933 if (as_client) { |
| 934 mycolor = opponent_color(mycolor); |
934 mycolor = opponent_color(mycolor); |
| 935 } |
935 } |
| 936 |
936 |
| 937 bool myturn = (gamestate->movecount > 0 ? |
937 bool myturn = current_color(gamestate) == mycolor; |
| 938 (last_move(gamestate).piece & COLOR_MASK) : BLACK) != mycolor; |
|
| 939 |
938 |
| 940 bool running; |
939 bool running; |
| 941 do { |
940 do { |
| 942 clear(); |
941 clear(); |
| 943 draw_board(gamestate, mycolor); |
942 draw_board(gamestate, mycolor); |