From acea380c8297962d08281764451837d6936c1a54 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 8 Oct 2010 11:47:34 +0200 Subject: [PATCH] Change evalgraph scale in drop games Score swings tend to be much larger in Crazyhouse and Shogi, so the vertical rangee in those games is doubled to (-14, 14). --- evalgraph.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/evalgraph.c b/evalgraph.c index 9aa1fe7..b5c18d0 100644 --- a/evalgraph.c +++ b/evalgraph.c @@ -50,6 +50,7 @@ ChessProgramStats_Move * currPvInfo; int currFirst = 0; int currLast = 0; int currCurrent = -1; +int range = 1; int nWidthPB = 0; int nHeightPB = 0; @@ -93,23 +94,23 @@ static int GetPvScore( int index ) */ static int GetValueY( int value ) { - if( value < -700 ) value = -700; - if( value > +700 ) value = +700; + if( value < -range*700 ) value = -range*700; + if( value > +range*700 ) value = +range*700; - return (nHeightPB / 2) - (int)(value * (nHeightPB - 2*MarginH) / 1400.0); + return (nHeightPB / 2) - (int)(value * (nHeightPB - 2*MarginH) / (1400.*range)); } // the brush selection is made part of the DrawLine, by passing a style argument // the wrapper for doing the text output makes this back-end static void DrawAxisSegmentHoriz( int value, Boolean drawValue ) { - int y = GetValueY( value*100 ); + int y = GetValueY( range*value*100 ); if( drawValue ) { char buf[MSG_SIZ], *b = buf; if( value > 0 ) *b++ = '+'; - sprintf(b, "%d", value); + sprintf(b, "%d", range*value); DrawEvalText(buf, strlen(buf), y); } @@ -328,6 +329,8 @@ int GetMoveIndexFromPoint( int x, int y ) // init and display part split of so they can be moved to front end void PaintEvalGraph( void ) { + VariantClass v = gameInfo.variant; + range = (gameInfo.holdingsWidth && v != VariantSuper && v != VariantGreat) ? 2 : 1; // [HGM] double range in drop games /* Draw */ DrawRectangle(0, 0, nWidthPB, nHeightPB, 2, FILLED); DrawAxis(); -- 1.7.0.4