X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=a5e26db4576c751f30e395e2b7ae54f8022177df;hb=b0c4bb81c045add757b010dc8319da38bad1d510;hp=9083ba95fe1e38fc56d79a5c1b8d2a0086c895e4;hpb=dbc7ef670385afc6ff41681c02f2e1b683f6ab24;p=xboard.git diff --git a/backend.c b/backend.c index 9083ba9..a5e26db 100644 --- a/backend.c +++ b/backend.c @@ -243,6 +243,7 @@ static int exiting = 0; /* [HGM] moved to top */ static int setboardSpoiledMachineBlack = 0 /*, errorExitFlag = 0*/; int startedFromPositionFile = FALSE; Board filePosition; /* [HGM] loadPos */ Board partnerBoard; /* [HGM] bughouse: for peeking at partner game */ +int partnerHighlight[2]; Boolean partnerBoardValid = 0; char partnerStatus[MSG_SIZ]; Boolean partnerUp; @@ -1107,6 +1108,11 @@ InitBackEnd3 P((void)) InitChessProgram(&first, startedFromSetupPosition); + if(!appData.noChessProgram) { /* [HGM] tidy: redo program version to use name from myname feature */ + free(programVersion); + programVersion = (char*) malloc(8 + strlen(PACKAGE_STRING) + strlen(first.tidy)); + sprintf(programVersion, "%s + %s", PACKAGE_STRING, first.tidy); + } if (appData.icsActive) { #ifdef WIN32 @@ -3761,7 +3767,7 @@ ParseBoard12(string) char promoChar; int ranks=1, files=0; /* [HGM] ICS80: allow variable board size */ char *bookHit = NULL; // [HGM] book - Boolean weird = FALSE, reqFlag = FALSE, repaint = FALSE; + Boolean weird = FALSE, reqFlag = FALSE; fromX = fromY = toX = toY = -1; @@ -3838,6 +3844,7 @@ ParseBoard12(string) if((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack) && newGameMode == IcsObserving && appData.bgObserve) { // [HGM] bughouse: don't act on alien boards while we play. Just parse the board and save it */ + char *toSqr; for (k = 0; k < ranks; k++) { for (j = 0; j < files; j++) board[k][j+gameInfo.holdingsWidth] = CharToPiece(board_chars[(ranks-1-k)*(files+1) + j]); @@ -3847,9 +3854,17 @@ ParseBoard12(string) } } CopyBoard(partnerBoard, board); - if(appData.dualBoard && !twoBoards) { twoBoards = repaint = 1; InitDrawingSizes(-2,0); } + if(toSqr = strchr(str, '/')) { // extract highlights from long move + partnerBoard[EP_STATUS-3] = toSqr[1] - AAA; // kludge: hide highlighting info in board + partnerBoard[EP_STATUS-4] = toSqr[2] - ONE; + } else partnerBoard[EP_STATUS-4] = partnerBoard[EP_STATUS-3] = -1; + if(toSqr = strchr(str, '-')) { + partnerBoard[EP_STATUS-1] = toSqr[1] - AAA; + partnerBoard[EP_STATUS-2] = toSqr[2] - ONE; + } else partnerBoard[EP_STATUS-1] = partnerBoard[EP_STATUS-2] = -1; + if(appData.dualBoard && !twoBoards) { twoBoards = 1; InitDrawingSizes(-2,0); } if(twoBoards) { partnerUp = 1; flipView = !flipView; } // [HGM] dual - if(partnerUp) DrawPosition(repaint, partnerBoard); + if(partnerUp) DrawPosition(FALSE, partnerBoard); if(twoBoards) { partnerUp = 0; flipView = !flipView; } // [HGM] dual sprintf(partnerStatus, "W: %d:%02d B: %d:%02d (%d-%d) %c", white_time/60000, (white_time%60000)/1000, (black_time/60000), (black_time%60000)/1000, white_stren, black_stren, to_play); @@ -15196,3 +15211,4 @@ LoadVariation(int index, char *text) CommentPopDown(); ToNrEvent(currentMove+1); } +