From: H.G. Muller Date: Tue, 11 Oct 2011 21:31:01 +0000 (+0200) Subject: Add option -discourageOwnBooks X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=86473f8c47a82552a7766df71bdd7e99a4830181;p=xboard.git Add option -discourageOwnBooks This boolean option determines the default setting of the hasOwnBook option before a tourney game starts. By setting it, the hasOwnBook option is cleared, which would enable use of the GUI book, like the engine was installedwith the /firstXBook option. An explicit option on the engine install line can still overrule this, though. A control to set this option has been added in the XBoard Match dialog, and it is saved in the tourney file to force consistency. --- diff --git a/args.h b/args.h index e22ebfc..0918244 100644 --- a/args.h +++ b/args.h @@ -558,6 +558,7 @@ ArgDescriptor argDescriptors[] = { { "polyglotBook", ArgFilename, (void *) &appData.polyglotBook, TRUE, (ArgIniType) "" }, { "bookDepth", ArgInt, (void *) &appData.bookDepth, TRUE, (ArgIniType) 12 }, { "bookVariation", ArgInt, (void *) &appData.bookStrength, TRUE, (ArgIniType) 50 }, + { "discourageOwnBooks", ArgBoolean, (void *) &appData.defNoBook, TRUE, (ArgIniType) FALSE }, { "defaultHashSize", ArgInt, (void *) &appData.defaultHashSize, TRUE, (ArgIniType) 64 }, { "defaultCacheSizeEGTB", ArgInt, (void *) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 }, { "defaultPathEGTB", ArgFilename, (void *) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" }, diff --git a/backend.c b/backend.c index eec214e..43f7926 100644 --- a/backend.c +++ b/backend.c @@ -9772,6 +9772,7 @@ WriteTourneyFile(char *results, FILE *f) fprintf(f, "-loadPositionFile \"%s\"\n", appData.loadPositionFile); fprintf(f, "-loadPositionIndex %d\n", appData.loadPositionIndex); fprintf(f, "-rewindIndex %d\n", appData.rewindIndex); + fprintf(f, "-discourageOwnBooks %s\n", appData.defNoBook ? "true" : "false"); if(searchTime > 0) fprintf(f, "-searchTime \"%d:%02d\"\n", searchTime/60, searchTime%60); else { @@ -9934,6 +9935,7 @@ SetPlayer(int player) if(mnemonic[i]) { snprintf(buf, MSG_SIZ, "-fcp %s", command[i]); ParseArgsFromString(resetOptions); appData.fenOverride[0] = NULL; appData.pvSAN[0] = FALSE; + appData.firstHasOwnBookUCI = !appData.defNoBook; ParseArgsFromString(buf); } free(engineName); diff --git a/common.h b/common.h index 9d5c0eb..928a85d 100644 --- a/common.h +++ b/common.h @@ -572,6 +572,7 @@ typedef struct { char * ucciAdapter; char * polyglotDir; Boolean usePolyglotBook; + Boolean defNoBook; char * polyglotBook; int bookDepth; int bookStrength; diff --git a/xoptions.c b/xoptions.c index e178bde..4cacc6b 100644 --- a/xoptions.c +++ b/xoptions.c @@ -364,6 +364,7 @@ Option matchOptions[] = { { 0, 0, 0, NULL, (void*) &appData.loadPositionFile, ".fen", NULL, FileName, N_("File with Start Positions:") }, { 0, -2, 1000000000, NULL, (void*) &appData.loadPositionIndex, "", NULL, Spin, N_("Position Number (-1 or -2 = Auto-Increment):") }, { 0, 0, 1000000000, NULL, (void*) &appData.rewindIndex, "", NULL, Spin, N_("Rewind Index after this many Games (0 = never):") }, +{ 0, 0, 0, NULL, (void*) &appData.defNoBook, "", NULL, CheckBox, N_("Disable own engine books by default") }, { 0, 0, 0, NULL, (void*) &ReplaceParticipant, NULL, NULL, Button, N_("Replace Engine") }, { 0, 1, 0, NULL, (void*) &UpgradeParticipant, NULL, NULL, Button, N_("Upgrade Engine") }, { 0, 1, 0, NULL, (void*) &MatchOK, "", NULL, EndMark , "" }