X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwengineo.c;h=1c3238f5d3ed61d0007c2bad715e3e089fd74092;hb=d016fb202fe45795e630e22ba516e754cf694ea6;hp=942f593449c6df29a9fdc96972d87ea53d72baa7;hpb=ea750683ac62717dd7346de17b5ae072622ff92a;p=xboard.git diff --git a/winboard/wengineo.c b/winboard/wengineo.c index 942f593..1c3238f 100644 --- a/winboard/wengineo.c +++ b/winboard/wengineo.c @@ -3,22 +3,26 @@ * * Author: Alessandro Scotti (Dec 2005) * + * Copyright 2005 Alessandro Scotti + * * ------------------------------------------------------------------------ - * This program is free software; you can redistribute it and/or modify + * + * GNU XBoard is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU XBoard is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * ------------------------------------------------------------------------ - */ + * along with this program. If not, see http://www.gnu.org/licenses/. * + * + *------------------------------------------------------------------------ + ** See the file ChangeLog for a revision history. */ + #include "config.h" #include /* required for all Windows applications */ @@ -76,6 +80,8 @@ extern HWND hwndMain; extern WindowPlacement wpEngineOutput; +extern BoardSize boardSize; + /* Module variables */ #define H_MARGIN 2 #define V_MARGIN 2 @@ -117,9 +123,9 @@ typedef struct { int an_move_count; } EngineOutputData; -static VerifyDisplayMode(); +static void VerifyDisplayMode(); static void UpdateControls( EngineOutputData * ed ); -static SetEngineState( int which, int state, char * state_data ); +static void SetEngineState( int which, int state, char * state_data ); // front end static HICON LoadIconEx( int id ) @@ -246,9 +252,9 @@ static void ResizeWindowControls( HWND hDlg, int mode ) { RECT rc; int headerHeight = GetHeaderHeight(); - int labelHeight = GetControlHeight( hDlg, IDC_EngineLabel1 ); - int labelOffset = H_MARGIN + ICON_SIZE + H_MARGIN; - int labelDeltaY = ICON_SIZE - labelHeight; +// int labelHeight = GetControlHeight( hDlg, IDC_EngineLabel1 ); +// int labelOffset = H_MARGIN + ICON_SIZE + H_MARGIN; +// int labelDeltaY = ICON_SIZE - labelHeight; int clientWidth; int clientHeight; int maxControlWidth; @@ -337,6 +343,10 @@ LRESULT CALLBACK EngineOutputProc( HWND hDlg, UINT message, WPARAM wParam, LPARA ResizeWindowControls( hDlg, windowMode ); + /* Set font */ + SendDlgItemMessage( engineOutputDialog, IDC_EngineMemo1, WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, MAKELPARAM(TRUE, 0 )); + SendDlgItemMessage( engineOutputDialog, IDC_EngineMemo2, WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, MAKELPARAM(TRUE, 0 )); + SetEngineState( 0, STATE_IDLE, "" ); SetEngineState( 1, STATE_IDLE, "" ); } @@ -446,7 +456,7 @@ void DoClearMemo(int which) // back end, due to front-end wrapper for SetWindowText, and new SetIcon arguments -static SetEngineState( int which, int state, char * state_data ) +static void SetEngineState( int which, int state, char * state_data ) { int x_which = 1 - which; @@ -537,7 +547,7 @@ void EngineOutputUpdate( FrontEndProgramStats * stats ) if( clearMemo ) DoClearMemo(which); /* Update */ - lastDepth[which] = depth; + lastDepth[which] = depth == 1 && ed.nodes == 0 ? 0 : depth; // [HGM] info-line kudge lastForwardMostMove[which] = forwardMostMove; if( ed.pv != 0 && ed.pv[0] == ' ' ) { @@ -579,6 +589,7 @@ char GetEngineColor( int which ) result = cps->twoMachinesColor[0]; result = result == 'w' ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; break; + default: ; // does not happen, but suppresses pedantic warnings } } @@ -616,6 +627,7 @@ static int IsEnginePondering( int which ) if( GetEngineColor( which ) != GetActiveEngineColor() ) result = TRUE; } break; + default: ; // does not happen, but suppresses pedantic warnings } return result; @@ -632,7 +644,7 @@ static void SetDisplayMode( int mode ) } // pure back end -static VerifyDisplayMode() +static void VerifyDisplayMode() { int mode; @@ -682,7 +694,7 @@ static void SetEngineColorIcon( int which ) // pure back end, now SetWindowText is called via wrapper DoSetWindowText static void UpdateControls( EngineOutputData * ed ) { - int isPondering = FALSE; +// int isPondering = FALSE; char s_label[MAX_NAME_LENGTH + 32]; @@ -725,7 +737,7 @@ static void UpdateControls( EngineOutputData * ed ) SetEngineState( ed->which, STATE_THINKING, "" ); } else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile - || gameMode == IcsObserving && appData.icsEngineAnalyze) { // [HGM] ICS-analyze + || (gameMode == IcsObserving && appData.icsEngineAnalyze)) { // [HGM] ICS-analyze char buf[64]; int time_secs = ed->time / 100; int time_mins = time_secs / 60; @@ -795,7 +807,8 @@ static void UpdateControls( EngineOutputData * ed ) sprintf( s_time, "%d:%02d.%02d", time_secs / 60, time_secs % 60, time_cent ); /* Put all together... */ - sprintf( buf, "%3d\t%s\t%s\t%s\t", ed->depth, s_score, s_nodes, s_time ); + if(ed->nodes == 0 && ed->score == 0 && ed->time == 0) sprintf( buf, "%3d\t", ed->depth ); else + sprintf( buf, "%3d\t%s\t%s\t%s\t", ed->depth, s_score, s_nodes, s_time ); /* Add PV */ buflen = strlen(buf);