X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=a5e26db4576c751f30e395e2b7ae54f8022177df;hb=b0c4bb81c045add757b010dc8319da38bad1d510;hp=01721f0723b6a73dfa461873a5db8d968605e5cc;hpb=76f00fe84ad4ba61b6eb39f374d32bde5714b9c0;p=xboard.git diff --git a/backend.c b/backend.c index 01721f0..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; @@ -3766,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; @@ -3843,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]); @@ -3852,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); @@ -15201,3 +15211,4 @@ LoadVariation(int index, char *text) CommentPopDown(); ToNrEvent(currentMove+1); } +