DisplayBothClocks();
else
StartClocks();
-
+
/* Display opponents and material strengths */
if (gameInfo.variant != VariantBughouse &&
- gameInfo.variant != VariantCrazyhouse) {
+ gameInfo.variant != VariantCrazyhouse && !appData.noGUI) {
if (tinyLayout || smallLayout) {
if(gameInfo.variant == VariantNormal)
- sprintf(str, "%s(%d) %s(%d) {%d %d}",
+ sprintf(str, "%s(%d) %s(%d) {%d %d}",
gameInfo.white, white_stren, gameInfo.black, black_stren,
basetime, increment);
else
}
}
-
+
/* Display the board */
- if (!pausing) {
-
+ if (!pausing && !appData.noGUI) {
-
if (appData.premove)
- if (!gotPremove ||
+ if (!gotPremove ||
((gameMode == IcsPlayingWhite) && (WhiteOnMove(currentMove))) ||
((gameMode == IcsPlayingBlack) && (!WhiteOnMove(currentMove))))
ClearPremoveHighlights();
int fromX, fromY, toX, toY;
/*char*/int promoChar;
{
- char *bookHit = 0;
-if(appData.debugMode) fprintf(debugFP, "moveType 5 = %d, promochar = %x\n", moveType, promoChar);
- if((gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) && promoChar != NULLCHAR) {
- // [HGM] superchess: suppress promotions to non-available piece
- int k = PieceToNumber(CharToPiece(ToUpper(promoChar)));
- if(WhiteOnMove(currentMove)) {
- if(!boards[currentMove][k][BOARD_WIDTH-2]) return 0;
- } else {
- if(!boards[currentMove][BOARD_HEIGHT-1-k][1]) return 0;
+ char *bookHit = 0;
+
+ if(appData.debugMode)
+ fprintf(debugFP, "moveType 5 = %d, promochar = %x\n", moveType, promoChar);
+
+ if((gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) && promoChar != NULLCHAR)
+ {
+ // [HGM] superchess: suppress promotions to non-available piece
+ int k = PieceToNumber(CharToPiece(ToUpper(promoChar)));
+ if(WhiteOnMove(currentMove))
+ {
+ if(!boards[currentMove][k][BOARD_WIDTH-2])
+ return 0;
+ }
+ else
+ {
+ if(!boards[currentMove][BOARD_HEIGHT-1-k][1])
+ return 0;
}
}
-
++
+ /* [HGM] <popupFix> kludge to avoid having to know the exact promotion
+ move type in caller when we know the move is a legal promotion */
+ if(moveType == NormalMove && promoChar)
+ moveType = PromoCharToMoveType(WhiteOnMove(currentMove), promoChar);
- if(appData.debugMode)
- /* [HGM] <popupFix> kludge to avoid having to know the exact promotion
- move type in caller when we know the move is a legal promotion */
- if(moveType == NormalMove && promoChar)
- moveType = PromoCharToMoveType(WhiteOnMove(currentMove), promoChar);
-if(appData.debugMode) fprintf(debugFP, "moveType 1 = %d, promochar = %x\n", moveType, promoChar);
- /* [HGM] convert drag-and-drop piece drops to standard form */
- if( fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) {
- moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop;
- if(appData.debugMode) fprintf(debugFP, "Drop move %d, curr=%d, x=%d,y=%d, p=%d\n",
++ if(appData.debugMode)
+ fprintf(debugFP, "moveType 1 = %d, promochar = %x\n", moveType, promoChar);
+
+ /* [HGM] convert drag-and-drop piece drops to standard form */
- if( fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1)
++ if( fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1)
+ {
+ moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop;
- fromX = boards[currentMove][fromY][fromX];
++ if(appData.debugMode)
++ fprintf(debugFP, "Drop move %d, curr=%d, x=%d,y=%d, p=%d\n",
+ moveType, currentMove, fromX, fromY, boards[currentMove][fromY][fromX]);
-// fromX = boards[currentMove][fromY][fromX];
- // holdings might not be sent yet in ICS play; we have to figure out which piece belongs here
- if(fromX == 0) fromY = BOARD_HEIGHT-1 - fromY; // black holdings upside-down
- fromX = fromX ? WhitePawn : BlackPawn; // first piece type in selected holdings
- while(PieceToChar(fromX) == '.' || PieceToNumber(fromX) != fromY && fromX != (int) EmptySquare) fromX++;
- fromY = DROP_RANK;
- }
-
- /* [HGM] <popupFix> The following if has been moved here from
- UserMoveEvent(). Because it seemed to belon here (why not allow
- piece drops in training games?), and because it can only be
- performed after it is known to what we promote. */
- if (gameMode == Training) {
++ // fromX = boards[currentMove][fromY][fromX];
++ // holdings might not be sent yet in ICS play; we have to figure out which piece belongs here
++ if(fromX == 0)
++ fromY = BOARD_HEIGHT-1 - fromY; // black holdings upside-down
++
++ fromX = fromX ? WhitePawn : BlackPawn; // first piece type in selected holdings
++
++ while(PieceToChar(fromX) == '.' || PieceToNumber(fromX) != fromY && fromX != (int) EmptySquare)
++ fromX++;
++
+ fromY = DROP_RANK;
+ }
+
+ /* [HGM] <popupFix> The following if has been moved here from
+ UserMoveEvent(). Because it seemed to belon here (why not allow
+ piece drops in training games?), and because it can only be
+ performed after it is known to what we promote. */
+ if (gameMode == Training)
+ {
/* compare the move played on the board to the next move in the
- * game. If they match, display the move and the opponent's response.
+ * game. If they match, display the move and the opponent's response.
* If they don't match, display an error message.
*/
int saveAnimate;
/* display last move only if game was not loaded from file */
if ((whosays != GE_FILE) && (currentMove == forwardMostMove))
DisplayMove(currentMove - 1);
-
+
if (forwardMostMove != 0) {
- if (gameMode != PlayFromGameFile && gameMode != EditGame) {
+ if (gameMode != PlayFromGameFile && gameMode != EditGame
+ && lastSavedGame != GameCheckSum() // [HGM] save: suppress duplicates
+ ) {
if (*appData.saveGameFile != NULLCHAR) {
SaveGameToFile(appData.saveGameFile, TRUE);
} else if (appData.autoSaveGames) {
DisplayTitle("");
DisplayMessage("", "");
HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1);
-
+ lastSavedGame = 0; // [HGM] save: make sure next game counts as unsaved
+ return;
}
void