if( (col + row) & 1 ) {\r
/* Lite square */\r
if( lite_w >= squareSize && lite_h >= squareSize ) {\r
+ if( lite_w >= squareSize*BOARD_WIDTH )\r
+ backTextureSquareInfo[row][col].x = (2*col+1)*lite_w/(2*BOARD_WIDTH) - squareSize/2; /* [HGM] cut out of center of virtual square */\r
+ else\r
backTextureSquareInfo[row][col].x = col * (lite_w - squareSize) / (BOARD_WIDTH-1); /* [HGM] divide by size-1 in stead of size! */\r
+ if( lite_h >= squareSize*BOARD_HEIGHT )\r
+ backTextureSquareInfo[row][col].y = (2*(BOARD_HEIGHT-row)-1)*lite_h/(2*BOARD_HEIGHT) - squareSize/2;\r
+ else\r
backTextureSquareInfo[row][col].y = (BOARD_HEIGHT-1-row) * (lite_h - squareSize) / (BOARD_HEIGHT-1);\r
backTextureSquareInfo[row][col].mode = GetBackTextureMode(liteBackTextureMode);\r
}\r
else {\r
/* Dark square */\r
if( dark_w >= squareSize && dark_h >= squareSize ) {\r
+ if( dark_w >= squareSize*BOARD_WIDTH )\r
+ backTextureSquareInfo[row][col].x = (2*col+1) * dark_w / (2*BOARD_WIDTH) - squareSize/2;\r
+ else\r
backTextureSquareInfo[row][col].x = col * (dark_w - squareSize) / (BOARD_WIDTH-1);\r
+ if( dark_h >= squareSize*BOARD_HEIGHT )\r
+ backTextureSquareInfo[row][col].y = (2*(BOARD_HEIGHT-row)-1) * dark_h / (2*BOARD_HEIGHT) - squareSize/2;\r
+ else\r
backTextureSquareInfo[row][col].y = (BOARD_HEIGHT-1-row) * (dark_h - squareSize) / (BOARD_HEIGHT-1);\r
backTextureSquareInfo[row][col].mode = GetBackTextureMode(darkBackTextureMode);\r
}\r