From: H.G. Muller Date: Thu, 9 Feb 2012 12:00:09 +0000 (+0100) Subject: Implement -pgnNumberTag option X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=114d6ef08a4a3be9cee4c878163e7a7c6e7486c9;p=xboard.git Implement -pgnNumberTag option A new (persistent) boolean option controls if the sequence number is to be written in saved tourney games as a Number tag, to make it easier to correlate games with debug files. --- diff --git a/args.h b/args.h index eb2833a..4848269 100644 --- a/args.h +++ b/args.h @@ -581,6 +581,7 @@ ArgDescriptor argDescriptors[] = { { "syncAfterRound", ArgBoolean, (void *) &appData.roundSync, FALSE, (ArgIniType) FALSE }, { "syncAfterCycle", ArgBoolean, (void *) &appData.cycleSync, FALSE, (ArgIniType) TRUE }, { "seedBase", ArgInt, (void *) &appData.seedBase, FALSE, (ArgIniType) 1 }, + { "pgnNumberTag", ArgBoolean, (void *) &appData.numberTag, TRUE, (ArgIniType) FALSE }, { "afterGame", ArgString, (void *) &appData.afterGame, FALSE, INVALID }, { "afterTourney", ArgString, (void *) &appData.afterTourney, FALSE, INVALID }, diff --git a/backend.c b/backend.c index 12a82a5..c85a2ac 100644 --- a/backend.c +++ b/backend.c @@ -12330,6 +12330,8 @@ SaveGamePGN (FILE *f) PrintPGNTags(f, &gameInfo); + if(appData.numberTag && matchMode) fprintf(f, "[Number \"%d\"]\n", nextGame+1); // [HGM] number tag + if (backwardMostMove > 0 || startedFromSetupPosition) { char *fen = PositionToFEN(backwardMostMove, NULL); fprintf(f, "[FEN \"%s\"]\n[SetUp \"1\"]\n", fen); diff --git a/common.h b/common.h index a044993..b1e13cc 100644 --- a/common.h +++ b/common.h @@ -684,6 +684,7 @@ typedef struct { int seedBase; Boolean roundSync; Boolean cycleSync; + Boolean numberTag; } AppData, *AppDataPtr; /* PGN tags (for showing in the game list) */