X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=evalgraph.c;h=1a8bd075e3b3fd5235b20abb7a0f59339961850a;hb=6c09cbad6fd5630f883937303fc5e10a5ef8e3dc;hp=c18d3d291186e8a4412278b8b4c8871a0a719e61;hpb=72f96a2581a9b7b0682e34cbf391d19d834c3d15;p=xboard.git diff --git a/evalgraph.c b/evalgraph.c index c18d3d2..1a8bd07 100644 --- a/evalgraph.c +++ b/evalgraph.c @@ -5,7 +5,8 @@ * * Copyright 2005 Alessandro Scotti * - * Enhancments Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * Enhancments Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, + * 2016 Free Software Foundation, Inc. * * ------------------------------------------------------------------------ * @@ -53,6 +54,7 @@ int currFirst = 0; int currLast = 0; int currCurrent = -1; int range = 1; +int differentialView; int nWidthPB = 0; int nHeightPB = 0; @@ -63,7 +65,7 @@ int MarginH = 4; // back-end static void -DrawLine (int x1, int y1, int x2, int y2, enum PEN penType) +DrawLine (int x1, int y1, int x2, int y2, int penType) { DrawSegment( x1, y1, NULL, NULL, PEN_NONE ); DrawSegment( x2, y2, NULL, NULL, penType ); @@ -71,7 +73,7 @@ DrawLine (int x1, int y1, int x2, int y2, enum PEN penType) // back-end static void -DrawLineEx (int x1, int y1, int x2, int y2, enum PEN penType) +DrawLineEx (int x1, int y1, int x2, int y2, int penType) { int savX, savY; DrawSegment( x1, y1, &savX, &savY, PEN_NONE ); @@ -85,6 +87,7 @@ GetPvScore (int index) { int score = currPvInfo[ index ].score; + if(differentialView) score = index < currLast-1 ? -currPvInfo[ index+1 ].score - score : 0; if( index & 1 ) score = -score; /* Flip score for black */ return score; @@ -102,7 +105,7 @@ MakeEvalTitle (char *title) if( depth <=0 ) return title; if( currCurrent & 1 ) score = -score; /* Flip score for black */ - snprintf(buf, MSG_SIZ, "%s {%d: %s%.2f/%-2d %d}", title, currCurrent/2+1, + snprintf(buf, MSG_SIZ, "%s {%d: %s%.2f/%-2d %d}", title, currCurrent/2+1, score>0 ? "+" : " ", score/100., depth, (currPvInfo[currCurrent].time+50)/100); return buf; @@ -152,7 +155,7 @@ static void DrawAxis () { int cy = nHeightPB / 2, space = nHeightPB/(6 + appData.zoom); - + DrawAxisSegmentHoriz( +5, TRUE ); DrawAxisSegmentHoriz( +3, space >= 20 ); DrawAxisSegmentHoriz( +1, space >= 20 && space*appData.zoom >= 40 ); @@ -312,15 +315,26 @@ static void DrawHistograms () { VisualizationData vd; + int i; double step = 1; if( InitVisualization( &vd ) ) { if( vd.hist_width < MIN_HIST_WIDTH ) { DrawHistogramAsDiagram( vd.cy, vd.paint_width, vd.hist_count ); + step = 0.5*vd.paint_width / (((vd.hist_count | 7) + 1)/2 + 1.); } else { - DrawHistogramFull( vd.cy, vd.hist_width, vd.hist_count ); + DrawHistogramFull( vd.cy, step = vd.hist_width, vd.hist_count ); } } + if(!differentialView) return; + differentialView = 0; + DrawSegment( MarginX + MarginW, vd.cy, NULL, NULL, PEN_NONE ); + for( i=0; i