int\r
MySearchPath(char *installDir, char *name, char *fullname)\r
{\r
- char *dummy;\r
+ char *dummy, buf[MSG_SIZ];\r
+ if(name[0] == '%' && strchr(name+1, '%')) { // [HGM] recognize %*% as environment variable\r
+ strcpy(buf, name+1);\r
+ *strchr(buf, '%') = 0;\r
+ installDir = getenv(buf);\r
+ sprintf(fullname, "%s\\%s", installDir, strchr(name+1, '%')+1);\r
+ return strlen(fullname);\r
+ }\r
return (int) SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy);\r
}\r
\r
if (appData.blindfold) return;\r
\r
/* [AS] Use font-based pieces if needed */\r
- if( fontBitmapSquareSize >= 0 && squareSize > 32 ) {\r
+ if( fontBitmapSquareSize >= 0 && (squareSize > 32 || gameInfo.variant >= VariantShogi)) {\r
/* Create piece bitmaps, or do nothing if piece set is up to date */\r
CreatePiecesFromFont();\r
\r
\r
SelectObject( tmphdc, hPieceMask[ index ] );\r
\r
+ if(appData.upsideDown ? color==flipView : (flipView && gameInfo.variant == VariantShogi))\r
+ StretchBlt(hdc, x+squareSize, y+squareSize, -squareSize, -squareSize, tmphdc, 0, 0, squareSize, squareSize, SRCAND);\r
+ else\r
BitBlt( hdc,\r
x, y,\r
squareSize, squareSize,\r
\r
SelectObject( tmphdc, hPieceFace[ index ] );\r
\r
+ if(appData.upsideDown ? color==flipView : (flipView && gameInfo.variant == VariantShogi))\r
+ StretchBlt(hdc, x+squareSize, y+squareSize, -squareSize, -squareSize, tmphdc, 0, 0, squareSize, squareSize, SRCPAINT);\r
+ else\r
BitBlt( hdc,\r
x, y,\r
squareSize, squareSize,\r
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
/* Mouse Wheel is being rolled forward\r
* Play moves forward\r
*/\r
- if((short)HIWORD(wParam) > 0 && currentMove < forwardMostMove) \r
+ if((short)HIWORD(wParam) < 0 && currentMove < forwardMostMove) \r
{ if(lastDir == 1) ForwardEvent(); else lastDir = 1; } // [HGM] suppress first event in direction\r
/* Mouse Wheel is being rolled backward\r
* Play moves backward\r
*/\r
- if((short)HIWORD(wParam) < 0 && currentMove > backwardMostMove) \r
+ if((short)HIWORD(wParam) > 0 && currentMove > backwardMostMove) \r
{ if(lastDir == -1) BackwardEvent(); else lastDir = -1; }\r
}\r
break;\r
TagsPopUp(tags, CmailMsg());\r
free(tags);\r
}\r
- SAY("programs start playing each other");\r
+ SAY("computer starts playing both sides");\r
break;\r
\r
case IDM_AnalysisMode:\r
\r
case IDM_EditPosition:\r
EditPositionEvent();\r
- SAY("to set up a position type a FEN");\r
+ SAY("enter a FEN string or setup a position on the board using the control R pop up menu");\r
break;\r
\r
case IDM_Training:\r
ReleaseCapture();\r
DrawPosition(TRUE, NULL);\r
}\r
+ TagsPopDown();\r
}\r
\r
\r