| 402 printw("Unknown move parser error."); |
402 printw("Unknown move parser error."); |
| 403 } |
403 } |
| 404 } |
404 } |
| 405 |
405 |
| 406 static void save_pgn(GameState *gamestate) { |
406 static void save_pgn(GameState *gamestate) { |
| 407 int y = getcury(stdscr); |
407 int y; |
| |
408 { |
| |
409 int x; |
| |
410 getyx(stdscr, y, x); |
| |
411 (void)x; /* we want to be POSIX curses compliant */ |
| |
412 } |
| 408 |
413 |
| 409 /* ask for player names */ |
414 /* ask for player names */ |
| 410 { |
415 { |
| 411 char pname[PLAYER_NAME_BUFLEN]; |
416 char pname[PLAYER_NAME_BUFLEN]; |
| 412 printw("\rWhite's name (%s): ", pgn_player_name(gamestate, WHITE)); |
417 printw("\rWhite's name (%s): ", pgn_player_name(gamestate, WHITE)); |
| 893 |
898 |
| 894 erase(); /* don't use clear() to avoid flickering */ |
899 erase(); /* don't use clear() to avoid flickering */ |
| 895 draw_board(&viewedstate, WHITE); |
900 draw_board(&viewedstate, WHITE); |
| 896 timecontrol(&viewedstate); |
901 timecontrol(&viewedstate); |
| 897 |
902 |
| 898 move(getmaxy(stdscr)-5, 0); |
903 move(input_getmaxy()-5, 0); |
| 899 if (gamestate->wresign) { |
904 if (gamestate->wresign) { |
| 900 addstr("White resigned.\n"); |
905 addstr("White resigned.\n"); |
| 901 } else if (gamestate->bresign) { |
906 } else if (gamestate->bresign) { |
| 902 addstr("Black resigned.\n"); |
907 addstr("Black resigned.\n"); |
| 903 } else if (gamestate->remis) { |
908 } else if (gamestate->remis) { |
| 960 echo(); |
965 echo(); |
| 961 gamestate_cleanup(&viewedstate); |
966 gamestate_cleanup(&viewedstate); |
| 962 } |
967 } |
| 963 |
968 |
| 964 static void game_play_singlemachine(GameState *gamestate) { |
969 static void game_play_singlemachine(GameState *gamestate) { |
| 965 inputy = getmaxy(stdscr) - 6; |
970 inputy = input_getmaxy() - 6; |
| 966 |
971 |
| 967 Color curcol = current_color(gamestate); |
972 Color curcol = current_color(gamestate); |
| 968 bool running = is_game_running(gamestate); |
973 bool running = is_game_running(gamestate); |
| 969 while (running) { |
974 while (running) { |
| 970 clear(); |
975 clear(); |
| 975 } |
980 } |
| 976 game_review(gamestate); |
981 game_review(gamestate); |
| 977 } |
982 } |
| 978 |
983 |
| 979 static void game_play(GameState *gamestate, int opponent, bool as_client) { |
984 static void game_play(GameState *gamestate, int opponent, bool as_client) { |
| 980 inputy = getmaxy(stdscr) - 6; |
985 inputy = input_getmaxy() - 6; |
| 981 |
986 |
| 982 Color mycolor = gamestate->info.servercolor; |
987 Color mycolor = gamestate->info.servercolor; |
| 983 if (as_client) { |
988 if (as_client) { |
| 984 mycolor = opponent_color(mycolor); |
989 mycolor = opponent_color(mycolor); |
| 985 } |
990 } |