From 7fb56edee87ea24c7b2b6b0065e73e5053650383 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 14 Oct 2009 14:42:37 -0700 Subject: [PATCH] fixed engingeoutput routine removed outdated code regarding analysis window --- backend.c | 92 +-------------------------------------------------- frontend.h | 2 + winboard/winboard.c | 2 - xboard.c | 2 - xoptions.c | 2 - 5 files changed, 3 insertions(+), 97 deletions(-) diff --git a/backend.c b/backend.c index c144984..9e1bf62 100644 --- a/backend.c +++ b/backend.c @@ -184,7 +184,6 @@ void FeedMovesToProgram P((ChessProgramState *cps, int upto)); void ResurrectChessProgram P((void)); void DisplayComment P((int moveNumber, char *text)); void DisplayMove P((int moveNumber)); -void DisplayAnalysis P((void)); void ParseGameHistory P((char *game)); void ParseBoard12 P((char *string)); @@ -6692,7 +6691,6 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. if (currentMove == forwardMostMove || gameMode == AnalyzeMode || gameMode == AnalyzeFile || appData.icsEngineAnalyze) { DisplayMove(currentMove - 1); - DisplayAnalysis(); } return; @@ -6720,7 +6718,6 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. if (currentMove == forwardMostMove || gameMode==AnalyzeMode || gameMode == AnalyzeFile || appData.icsEngineAnalyze) { DisplayMove(currentMove - 1); - DisplayAnalysis(); } return; } else if (sscanf(message,"stat01: %d " u64Display " %d %d %d %s", @@ -6745,7 +6742,6 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. SendProgramStatsToFrontend( cps, &programStats ); - DisplayAnalysis(); return; } else if (strncmp(message,"++",2) == 0) { @@ -6781,7 +6777,6 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. if (currentMove == forwardMostMove || gameMode==AnalyzeMode || gameMode == AnalyzeFile || appData.icsEngineAnalyze) { DisplayMove(currentMove - 1); - DisplayAnalysis(); } return; } @@ -10852,7 +10847,6 @@ ExitAnalyzeMode() SendToProgram("exit\n", &first); first.analyzing = FALSE; } - EngineOutputPopDown(); thinkOutput[0] = NULLCHAR; } @@ -12553,7 +12547,7 @@ PeriodicUpdatesEvent(newState) appData.periodicUpdates=newState; /* Display type changes, so update it now */ - DisplayAnalysis(); +// DisplayAnalysis(); /* Get the ball rolling again... */ if (newState) { @@ -12693,90 +12687,6 @@ DisplayMove(moveNumber) } void -DisplayAnalysisText(text) - char *text; -{ - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile - || appData.icsEngineAnalyze) - { - EngineOutputPopUp(); - } -} - -static int -only_one_move(str) - char *str; -{ - while (*str && isspace(*str)) ++str; - while (*str && !isspace(*str)) ++str; - if (!*str) return 1; - while (*str && isspace(*str)) ++str; - if (!*str) return 1; - return 0; -} - -void -DisplayAnalysis() -{ - char buf[MSG_SIZ]; - char lst[MSG_SIZ / 2]; - double nps; - static char *xtra[] = { "", " (--)", " (++)" }; - int h, m, s, cs; - - if (programStats.time == 0) { - programStats.time = 1; - } - - if (programStats.got_only_move) { - safeStrCpy(buf, programStats.movelist, sizeof(buf)); - } else { - safeStrCpy( lst, programStats.movelist, sizeof(lst)); - - nps = (u64ToDouble(programStats.nodes) / - ((double)programStats.time /100.0)); - - cs = programStats.time % 100; - s = programStats.time / 100; - h = (s / (60*60)); - s = s - h*60*60; - m = (s/60); - s = s - m*60; - - if (programStats.moves_left > 0 && appData.periodicUpdates) { - if (programStats.move_name[0] != NULLCHAR) { - sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - programStats.nr_moves-programStats.moves_left, - programStats.nr_moves, programStats.move_name, - ((float)programStats.score)/100.0, lst, - only_one_move(lst)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } else { - sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - programStats.nr_moves-programStats.moves_left, - programStats.nr_moves, ((float)programStats.score)/100.0, - lst, - only_one_move(lst)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } - } else { - sprintf(buf, "depth=%d %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - ((float)programStats.score)/100.0, - lst, - only_one_move(lst)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } - } - DisplayAnalysisText(buf); -} - -void DisplayComment(moveNumber, text) int moveNumber; char *text; diff --git a/frontend.h b/frontend.h index ef8cef6..586720d 100644 --- a/frontend.h +++ b/frontend.h @@ -159,6 +159,8 @@ void TagsPopDown P((void)); void ICSInitScript P((void)); void StartAnalysisClock P((void)); +void EngineOutputPopUp P((void)); +void EgineOutputPopDown P((void)); void SetHighlights P((int fromX, int fromY, int toX, int toY)); void ClearHighlights P((void)); diff --git a/winboard/winboard.c b/winboard/winboard.c index d9134d7..aaf6150 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -5631,14 +5631,12 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) switch (wmId) { case IDM_NewGame: ResetGameEvent(); - EngineOutputPopDown(); SAY("new game enter a move to play against the computer with white"); break; case IDM_NewGameFRC: if( NewGameFRC() == 0 ) { ResetGameEvent(); - EngineOutputPopDown(); } break; diff --git a/xboard.c b/xboard.c index 982c373..dfe70cd 100644 --- a/xboard.c +++ b/xboard.c @@ -1897,7 +1897,6 @@ XtActionsRec boardActions[] = { { "TagsPopDown", (XtActionProc) TagsPopDown }, { "ErrorPopDown", (XtActionProc) ErrorPopDown }, { "ICSInputBoxPopDown", (XtActionProc) ICSInputBoxPopDown }, - { "EngineOutputPopDown", (XtActionProc) EngineOutputPopDown }, { "FileNamePopDown", (XtActionProc) FileNamePopDown }, { "AskQuestionPopDown", (XtActionProc) AskQuestionPopDown }, { "GameListPopDown", (XtActionProc) GameListPopDown }, @@ -6253,7 +6252,6 @@ void ResetProc(w, event, prms, nprms) Cardinal *nprms; { ResetGameEvent(); - EngineOutputPopDown(); } int LoadGamePopUp(f, gameNumber, title) diff --git a/xoptions.c b/xoptions.c index 514c9d6..25d3fe7 100644 --- a/xoptions.c +++ b/xoptions.c @@ -142,7 +142,6 @@ void ShuffleCallback(w, client_data, call_data) ShufflePopDown(); shuffleOpenings = False; // [HGM] should be moved to New Variant menu, once we have it! ResetGameEvent(); - EngineOutputPopDown(); return; } if (strcmp(name, _("random")) == 0) { @@ -164,7 +163,6 @@ void ShuffleCallback(w, client_data, call_data) shuffleOpenings = True; ShufflePopDown(); ResetGameEvent(); - EngineOutputPopDown(); return; } } -- 1.7.0.4