From: H.G.Muller Date: Mon, 2 Mar 2015 11:49:36 +0000 (+0100) Subject: Implement -rankOffset option X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8ec787419ed071b5eaf5710a6a10637ec9fb7a58;p=xboard.git Implement -rankOffset option This option is useful on boards with blacked-out ranks, to force rank number one to be a higher up. --- diff --git a/args.h b/args.h index f0e6423..7e39735 100644 --- a/args.h +++ b/args.h @@ -634,6 +634,7 @@ ArgDescriptor argDescriptors[] = { { "oneClickMove", ArgBoolean, (void *) &appData.oneClick, TRUE, (ArgIniType) FALSE }, { "boardWidth", ArgInt, (void *) &appData.NrFiles, FALSE, (ArgIniType) -1 }, { "boardHeight", ArgInt, (void *) &appData.NrRanks, FALSE, (ArgIniType) -1 }, + { "rankOffset", ArgInt, (void *) &appData.rankOffset, FALSE, (ArgIniType) 0 }, { "holdingsSize", ArgInt, (void *) &appData.holdingsSize, FALSE, (ArgIniType) -1 }, { "defaultMatchGames", ArgInt, (void *) &appData.defaultMatchGames, TRUE, (ArgIniType) 10 }, { "matchPause", ArgInt, (void *) &appData.matchPause, TRUE, (ArgIniType) 10000 }, diff --git a/common.h b/common.h index 492c507..6239e13 100644 --- a/common.h +++ b/common.h @@ -186,7 +186,7 @@ typedef char *String; #define EP_FILE CASTLING][(BOARD_FILES-3) /* [HGM] in upper rank */ #define EP_STATUS CASTLING][(BOARD_FILES-2) /* [HGM] in upper rank */ #define HOLDINGS_SET CASTLING][(BOARD_FILES-1) /* [HGM] in upper-right corner*/ -#define ONE ('1'-(BOARD_HEIGHT==10)) /* [HGM] foremost board rank */ +#define ONE ('1'-(BOARD_HEIGHT==10)-appData.rankOffset) /* [HGM] foremost board rank */ #define AAA ('a'-BOARD_LEFT) /* [HGM] leftmost board file */ #define VIRGIN_W 1 /* [HGM] flags in Board[VIRGIN][X] */ #define VIRGIN_B 2 @@ -689,6 +689,7 @@ typedef struct { /* [HGM] Board size */ int NrFiles; int NrRanks; + int rankOffset; int holdingsSize; int matchPause; char * pieceToCharTable;