X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fcommondsp.c;h=39d8500dbbd30eb28dbb76aae4295dcaf26c8b96;hb=6cdb4afe21c8d0eb740a6a22a02a0adf922fddfc;hp=1ed6e1ba29c497d6b851319a8a6d491d06dbf180;hpb=b18dc4fd00c0055eae9128c28a36412f83b998b4;p=gnushogi.git diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 1ed6e1b..39d8500 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -42,7 +42,6 @@ #include #include -#include #include "gnushogi.h" char mvstr[4][6]; @@ -298,20 +297,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv) if (SqAttacked(PieceList[opponent][0], computer, &blocked)) { UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst); - - if (NOT_CURSES) - { - /* Illegal move in check */ - printf(CP[77], s); - printf("\n"); - } - else - { - /* Illegal move in check */ - sprintf(buffer, CP[77], s); - ShowMessage(buffer); - } - + AlwaysShowMessage(CP[77], s); return false; } else @@ -353,17 +339,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv) } } - if (NOT_CURSES) - { - /* Illegal move */ - printf (CP[75], s); - } - else /* Curses. */ - { - /* Illegal move */ - sprintf(buffer, CP[76], s); - ShowMessage(buffer); - } + AlwaysShowMessage(CP[76], s); if (!barebones && (cnt > 1)) { @@ -1592,16 +1568,7 @@ InputCommand(char *command) Sdepth = 0; #ifdef QUIETBACKGROUND - if (NOT_CURSES) - { - PromptForMove(); - } - else - { - ShowSidetoMove(); - ShowPrompt(); - } - + ShowPrompt(); have_shown_prompt = true; #endif /* QUIETBACKGROUND */ @@ -1648,15 +1615,7 @@ InputCommand(char *command) { #endif /* QUIETBACKGROUND */ - if (NOT_CURSES) - { - PromptForMove(); - } - else - { - ShowSidetoMove(); - ShowPrompt(); - } + ShowPrompt(); #ifdef QUIETBACKGROUND } @@ -1664,23 +1623,12 @@ InputCommand(char *command) have_shown_prompt = false; #endif /* QUIETBACKGROUND */ - if (command == NULL) - { + if (command == NULL) { if (NOT_CURSES) - { - s[0] = sx[0] = '\0'; + s[0] = '\0'; - while(!eof && !sx[0]) - eof = (fgets(sx, 80, stdin) == NULL); - } - else - { - fflush(stdout); - eof = (getstr(sx) == ERR); - } - } - else - { + eof = GetString(sx); + } else { strcpy(sx, command); done = true; } @@ -1731,7 +1679,7 @@ InputCommand(char *command) { EditBoard(); } - else if (NOT_CURSES && (strcmp(s, CP[190]) == 0)) /* setup */ + else if ((strcmp(s, CP[190]) == 0)) /* setup */ { SetupBoard(); }