From: H.G. Muller Date: Wed, 4 Nov 2009 02:26:06 +0000 (-0800) Subject: let the clocks run in -searchTime mode X-Git-Tag: master-20091122~22 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=11bdae9e46aaeb00dd46db45908919e1e22e5590 let the clocks run in -searchTime mode --- diff --git a/backend.c b/backend.c index 6f4fa71..0a51282 100755 --- a/backend.c +++ b/backend.c @@ -794,7 +794,8 @@ InitBackEnd1() 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; } @@ -13131,7 +13132,7 @@ CheckFlags() 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; /* @@ -13257,6 +13258,9 @@ ResetClocks() (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; @@ -13386,6 +13390,12 @@ SwitchClocks() 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);