From: H.G.Muller Date: Thu, 28 Apr 2016 12:36:54 +0000 (+0200) Subject: Allow engine to specify holdings larger than board height X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=ad8ab1d60e56eee56574c54704f4804df6eef54b Allow engine to specify holdings larger than board height On reception of a 'setup' command we now automatically increase the number of board ranks to the holdings size if the latter is larger, but remember the number of added 'dead ranks'. When parsing a FEN these ranks are blacked out, and on generating a FEN they are ignored. This makes FENs behave like the board was not enlarged. --- diff --git a/backend.c b/backend.c index 23bfda7..e0830fc 100644 --- a/backend.c +++ b/backend.c @@ -261,6 +261,7 @@ void ics_update_width P((int new_width)); extern char installDir[MSG_SIZ]; VariantClass startVariant; /* [HGM] nicks: initial variant */ Boolean abortMatch; +int deadRanks; extern int tinyLayout, smallLayout; ChessProgramStats programStats; @@ -7397,7 +7398,7 @@ MarkByFEN(char *fen) int r, f; if(!appData.markers || !appData.highlightDragging) return; for(r=0; r= 0; i--) { + for (i = BOARD_HEIGHT - 1 - deadRanks; i >= 0; i--) { if(MSG_SIZ - (p - buf) < BOARD_RGHT - BOARD_LEFT + 20) { *p = 0; return StrSave(buf); } emptycount = 0; for (j = BOARD_LEFT; j < BOARD_RGHT; j++) { @@ -18400,8 +18403,10 @@ ParseFEN (Board board, int *blackPlaysFirst, char *fen, Boolean autoSize) p = fen; + for(i=1; i<=deadRanks; i++) for(j=BOARD_LEFT; j= 0; i--) { + for (i = BOARD_HEIGHT - 1 - deadRanks; i >= 0; i--) { j = 0; for (;;) { if (*p == '/' || *p == ' ' || *p == '[' ) {