{ "ruleMoves", ArgInt, (void *) &appData.ruleMoves, TRUE, (ArgIniType) 51 },
{ "repeatsToDraw", ArgInt, (void *) &appData.drawRepeats, TRUE, (ArgIniType) 6 },
{ "backgroundObserve", ArgBoolean, (void *) &appData.bgObserve, TRUE, (ArgIniType) FALSE },
+ { "dualBoard", ArgBoolean, (void *) &appData.dualBoard, TRUE, (ArgIniType) FALSE },
{ "autoKibitz", ArgTrue, (void *) &appData.autoKibitz, FALSE, INVALID },
{ "engineDebugOutput", ArgInt, (void *) &appData.engineComments, FALSE, (ArgIniType) 1 },
{ "userName", ArgString, (void *) &appData.userName, FALSE, INVALID },
char partnerStatus[MSG_SIZ];
Boolean partnerUp;
Boolean originalFlip;
+Boolean twoBoards = 0;
char endingGame = 0; /* [HGM] crash: flag to prevent recursion of GameEnds() */
int whiteNPS, blackNPS; /* [HGM] nps: for easily making clocks aware of NPS */
VariantClass currentlyInitializedVariant; /* [HGM] variantswitch */
/* [HGM] copy holdings to partner-board holdings area */
CopyHoldings(partnerBoard, white_holding, WhitePawn);
CopyHoldings(partnerBoard, black_holding, BlackPawn);
+ if(twoBoards) { partnerUp = 1; flipView = !flipView; } // [HGM] dual: always draw
if(partnerUp) DrawPosition(FALSE, partnerBoard);
+ if(twoBoards) { partnerUp = 0; flipView = !flipView; DrawPosition(TRUE, boards[currentMove]); } // [HGM] dual: redraw own
}
}
/* Suppress following prompt */
board[k][1] = board[k][BOARD_WIDTH-2] = (ChessSquare) 0;;
}
}
+ if(appData.dualBoard) { twoBoards = partnerUp = 1; flipView = !flipView; InitDrawingSizes(-2,0); } // [HGM] dual
CopyBoard(partnerBoard, board);
if(partnerUp) DrawPosition(FALSE, partnerBoard);
+ if(twoBoards) { partnerUp = 0; flipView = !flipView; DrawPosition(TRUE, boards[currentMove]); } // [HGM] dual: redraw own game!
sprintf(partnerStatus, "W: %d:%d B: %d:%d (%d-%d) %c", white_time/60000, (white_time%60000)/1000,
(black_time/60000), (black_time%60000)/1000, white_stren, black_stren, to_play);
DisplayMessage(partnerStatus, "");
if(endingGame) return; /* [HGM] crash: forbid recursion */
endingGame = 1;
+ if(twoBoards) { twoBoards = partnerUp = 0; InitDrawingSizes(-2, 0); } // [HGM] dual
if (appData.debugMode) {
fprintf(debugFP, "GameEnds(%d, %s, %d)\n",
int highlightArrowColor;
Boolean useStickyWindows;
Boolean bgObserve; /* [HGM] bughouse */
+ Boolean dualBoard; /* [HGM] dual */
int adjudicateDrawMoves;
Boolean autoDisplayComment;
Boolean autoDisplayTags;
}\r
\r
\r
+extern Boolean twoBoards, partnerUp; // [HGM] dual\r
\r
VOID\r
InitDrawingSizes(BoardSize boardSize, int flags)\r
winW = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN;\r
winH = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) +\r
GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN;\r
+ winW *= 1 + twoBoards;\r
if(suppressVisibleEffects) return; // [HGM] when called for filling sizeInfo only\r
wpMain.width = winW; // [HGM] placement: set through temporary which can used by initial sizing choice\r
wpMain.height = winH; // without disturbing window attachments\r
if( DrawPositionNeedsFullRepaint() ) {\r
fullrepaint = TRUE;\r
}\r
+ if(twoBoards) fullrepaint = TRUE; // [HGM] dual: our memory of last-drawn will be all wrong\r
\r
if (board == NULL) {\r
if (!lastReqValid) {\r
* This way we avoid any flickering\r
*/\r
oldBitmap = SelectObject(tmphdc, bufferBitmap);\r
- BitBlt(hdc, boardRect.left, boardRect.top,\r
+ BitBlt(hdc, boardRect.left + twoBoards*partnerUp*wpMain.width/2, boardRect.top, // [HGM] dual\r
boardRect.right - boardRect.left,\r
boardRect.bottom - boardRect.top,\r
tmphdc, boardRect.left, boardRect.top, SRCCOPY);\r
menuBarWidget, buttonBarWidget, editShell, errorShell, analysisShell,
ICSInputShell, fileNameShell, askQuestionShell;
Widget historyShell, evalGraphShell, gameListShell;
+int hOffset; // [HGM] dual
+XSegment secondSegments[BOARD_RANKS + BOARD_FILES + 2];
XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2];
XSegment jailGridSegments[BOARD_RANKS + BOARD_FILES + 6];
Font clockFontID, coordFontID, countFontID;
//--------------------------------------------------------------------------------------------
+extern Boolean twoBoards, partnerUp;
+
#ifdef IDSIZES
// eventually, all layout determining code should go into a subroutine, but until then IDSIZE remains undefined
#else
shellArgs[1].value = (XtArgVal) &h;
XtGetValues(shellWidget, shellArgs, 2);
- shellArgs[4].value = 2*w; shellArgs[2].value = 10;
+ shellArgs[4].value = 3*w; shellArgs[2].value = 10;
shellArgs[5].value = 2*h; shellArgs[3].value = 10;
XtSetValues(shellWidget, &shellArgs[2], 4);
boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap);
boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap);
CreateGrid();
+ hOffset = boardWidth + 10;
+ for(i=0; i<BOARD_WIDTH+BOARD_HEIGHT+2; i++) { // [HGM] dual: grid for second board
+ secondSegments[i] = gridSegments[i];
+ secondSegments[i].x1 += hOffset;
+ secondSegments[i].x2 += hOffset;
+ }
XtSetArg(args[0], XtNwidth, boardWidth);
XtSetArg(args[1], XtNheight, boardHeight);
/*
* Inhibit shell resizing.
*/
- shellArgs[0].value = w = (XtArgVal) boardWidth + marginW;
+ shellArgs[0].value = w = (XtArgVal) boardWidth + marginW + twoBoards*hOffset; // [HGM] dual
shellArgs[1].value = h = (XtArgVal) boardHeight + marginH;
shellArgs[4].value = shellArgs[2].value = w;
shellArgs[5].value = shellArgs[3].value = h;
(squareSize + lineGap);
}
+ if(twoBoards && partnerUp) x += hOffset; // [HGM] dual: draw second board
+
square_color = SquareColor(row, column);
if ( // [HGM] holdings: blank out area between board and holdings
int rrow, rcol;
if(DrawSeekGraph()) return; // [HGM] seekgraph: suppress any drawing if seek graph up
+ if(twoBoards) repaint = True;
if (board == NULL) {
if (!lastBoardValid) return;
} else {
if (lineGap > 0)
XDrawSegments(xDisplay, xBoardWindow, lineGC,
+ twoBoards & partnerUp ? secondSegments : // [HGM] dual
gridSegments, BOARD_HEIGHT + BOARD_WIDTH + 2);
for (i = 0; i < BOARD_HEIGHT; i++)