if (appData.icsActive) {
appData.clockMode = TRUE; /* changes dynamically in ICS mode */
- } else if (*appData.searchTime != NULLCHAR || appData.noChessProgram) {
+// } else if (*appData.searchTime != NULLCHAR || appData.noChessProgram) {
+ } else if (appData.noChessProgram) { // [HGM] st: searchTime mode now also is clockMode
appData.clockMode = FALSE;
first.sendTime = second.sendTime = 0;
}
/* Usually suppress following prompt */
if (!(forwardMostMove == 0 && gameMode == IcsExamining)) {
+ while(looking_at(buf, &i, "\n")); // [HGM] skip empty lines
if (looking_at(buf, &i, "*% ")) {
savingComment = FALSE;
}
if(x >= 0 && x < BOARD_LEFT || x >= BOARD_RGHT) {
ClearHighlights();
fromX = fromY = -1;
+ DrawPosition(TRUE, NULL);
return;
}
char title[MSG_SIZ];
char buf[8000]; // comment can be long!
int score, depth;
-
- if( appData.autoDisplayComment ) {
- if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) {
- strcpy(title, "Comment");
- } else {
- sprintf(title, "Comment on %d.%s%s", moveNumber / 2 + 1,
- WhiteOnMove(moveNumber) ? " " : ".. ",
- parseList[moveNumber]);
- }
- // [HGM] PV info: display PV info together with (or as) comment
- if(moveNumber >= 0 && (depth = pvInfoList[moveNumber].depth) > 0) {
- if(text == NULL) text = "";
- score = pvInfoList[moveNumber].score;
- sprintf(buf, "%s%.2f/%d %d\n%s", score>0 ? "+" : "", score/100.,
- depth, (pvInfoList[moveNumber].time+50)/100, text);
- text = buf;
- }
- } else title[0] = 0;
-
- if (text != NULL)
+
+ if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) {
+ strcpy(title, "Comment");
+ } else {
+ sprintf(title, "Comment on %d.%s%s", moveNumber / 2 + 1,
+ WhiteOnMove(moveNumber) ? " " : ".. ",
+ parseList[moveNumber]);
+ }
+ // [HGM] PV info: display PV info together with (or as) comment
+ if(moveNumber >= 0 && (depth = pvInfoList[moveNumber].depth) > 0) {
+ if(text == NULL) text = "";
+ score = pvInfoList[moveNumber].score;
+ sprintf(buf, "%s%.2f/%d %d\n%s", score>0 ? "+" : "", score/100.,
+ depth, (pvInfoList[moveNumber].time+50)/100, text);
+ text = buf;
+ }
+ if (text != NULL && (appData.autoDisplayComment || commentUp))
CommentPopUp(title, text);
}
void
CheckTimeControl()
{
- if (!appData.clockMode || appData.icsActive ||
+ if (!appData.clockMode || appData.icsActive || searchTime || // [HGM] st: no inc in st mode
gameMode == PlayFromGameFile || forwardMostMove == 0) return;
/*
(void) StopClockTimer();
if (appData.icsActive) {
whiteTimeRemaining = blackTimeRemaining = 0;
+ } else if (searchTime) {
+ whiteTimeRemaining = 1000*searchTime / WhitePlayer()->timeOdds;
+ blackTimeRemaining = 1000*searchTime / WhitePlayer()->other->timeOdds;
} else { /* [HGM] correct new time quote for time odds */
whiteTimeRemaining = GetTimeQuota(-1) / WhitePlayer()->timeOdds;
blackTimeRemaining = GetTimeQuota(-1) / WhitePlayer()->other->timeOdds;
break;
}
+ if (searchTime) { // [HGM] st: set clock of player that has to move to max time
+ if(WhiteOnMove(forwardMostMove))
+ whiteTimeRemaining = 1000*searchTime / WhitePlayer()->timeOdds;
+ else blackTimeRemaining = 1000*searchTime / WhitePlayer()->other->timeOdds;
+ }
+
tickStartTM = now;
intendedTickLength = NextTickLength(WhiteOnMove(forwardMostMove) ?
whiteTimeRemaining : blackTimeRemaining);