From 3681f490b0a9cdaadd754972147b5140cf2c269b Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 9 May 2011 09:10:47 +0200 Subject: [PATCH] Add option -absoluteAnalysisScores This persistent option flips scores in the when black is thinking in analysis mode, just before they are printed in the engine-output window. --- args.h | 1 + backend.c | 4 ++-- common.h | 1 + engineoutput.c | 13 +++++++------ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/args.h b/args.h index 693877e..fb9a263 100644 --- a/args.h +++ b/args.h @@ -613,6 +613,7 @@ ArgDescriptor argDescriptors[] = { { "fn", ArgString, (void *) &appData.pgnName[0], FALSE, INVALID }, { "secondPgnName", ArgString, (void *) &appData.pgnName[1], FALSE, (ArgIniType) "" }, { "sn", ArgString, (void *) &appData.pgnName[1], FALSE, INVALID }, + { "absoluteAnalysisScores", ArgBoolean, (void *) &appData.whitePOV, TRUE, FALSE }, #if ZIPPY { "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK }, diff --git a/backend.c b/backend.c index 999fcfd..d14530f 100644 --- a/backend.c +++ b/backend.c @@ -5335,12 +5335,12 @@ LoadMultiPV(int x, int y, char *buf, int index, int *start, int *end) buf[index] = 0; if(lineStart == 0 && gameMode == AnalyzeMode && (multi = MultiPV(&first)) >= 0) { int n = first.option[multi].value; - if(origIndex < 10) { if(n>1) n--; } else if(origIndex > index - 6) n++; + if(origIndex > 17 && origIndex < 24) { if(n>1) n--; } else if(origIndex > index - 6) n++; snprintf(buf2, MSG_SIZ, "option MultiPV=%d\n", n); if(first.option[multi].value != n) SendToProgram(buf2, &first); first.option[multi].value = n; *start = *end = 0; - return TRUE; + return FALSE; } ParsePV(buf+startPV, FALSE, gameMode != AnalyzeMode); *start = startPV; *end = index-1; diff --git a/common.h b/common.h index b84760e..94031ad 100644 --- a/common.h +++ b/common.h @@ -645,6 +645,7 @@ typedef struct { Boolean markers; /* [HGM] markers */ Boolean pieceMenu; Boolean sweepSelect; + Boolean whitePOV; char *tourneyFile; char *processes; diff --git a/engineoutput.c b/engineoutput.c index 12081f5..463f652 100644 --- a/engineoutput.c +++ b/engineoutput.c @@ -173,8 +173,8 @@ void SetProgramStats( FrontEndProgramStats * stats ) // now directly called by b DoClearMemo(which); nrVariations[which] = 0; header[0] = NULLCHAR; if(gameMode == AnalyzeMode && (multi = MultiPV(&first)) >= 0) { - snprintf(header, MSG_SIZ, "\t\t\t\tfewer / Multi-PV setting = %d / more\n", - first.option[multi].value); + snprintf(header, MSG_SIZ, "\t%s viewpoint\t\tfewer / Multi-PV setting = %d / more\n", + appData.whitePOV ? "white" : "mover", first.option[multi].value); InsertIntoMemo( which, header, 0); } else if(appData.ponderNextMove && lastLine[which][0]) { @@ -361,7 +361,7 @@ static void UpdateControls( EngineOutputData * ed ) // int isPondering = FALSE; char s_label[MAX_NAME_LENGTH + 32]; - + int h; char * name = ed->name; /* Label */ @@ -461,11 +461,12 @@ static void UpdateControls( EngineOutputData * ed ) } /* Score */ - if( ed->score > 0 ) { - snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), "+%.2f", ed->score / 100.0 ); + h = (gameMode == AnalyzeMode && appData.whitePOV && !WhiteOnMove(currentMove) ? -1 : 1) * ed->score; + if( h > 0 ) { + snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), "+%.2f", h / 100.0 ); } else { - snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), "%.2f", ed->score / 100.0 ); + snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), "%.2f", h / 100.0 ); } /* Time */ -- 1.7.0.4