char *settingsFileName;\r
Boolean saveSettingsOnExit;\r
char installDir[MSG_SIZ];\r
+int errorExitStatus;\r
\r
BoardSize boardSize;\r
Boolean chessProgram;\r
static HBRUSH lightSquareBrush, darkSquareBrush,\r
blackSquareBrush, /* [HGM] for band between board and holdings */\r
explodeBrush, /* [HGM] atomic */\r
+ markerBrush, /* [HGM] markers */\r
whitePieceBrush, blackPieceBrush, iconBkgndBrush /*, outlineBrush*/;\r
static POINT gridEndpoints[(BOARD_RANKS + BOARD_FILES + 2) * 2];\r
static DWORD gridVertexCounts[BOARD_RANKS + BOARD_FILES + 2];\r
blackPieceBrush = CreateSolidBrush(blackPieceColor);\r
iconBkgndBrush = CreateSolidBrush(GetSysColor(COLOR_BACKGROUND));\r
explodeBrush = CreateSolidBrush(highlightSquareColor); // [HGM] atomic\r
+ markerBrush = CreateSolidBrush(premoveHighlightColor); // [HGM] markers\r
/* [AS] Force rendering of the font-based pieces */\r
if( fontBitmapSquareSize > 0 ) {\r
fontBitmapSquareSize = 0;\r
DrawHighlightsOnDC(hdcmem);\r
DrawBoardOnDC(hdcmem, board, tmphdc);\r
}\r
+ for (row = 0; row < BOARD_HEIGHT; row++) {\r
+ for (column = 0; column < BOARD_WIDTH; column++) {\r
+ if (marker[row][column]) { // marker changes only occur with full repaint!\r
+ HBRUSH oldBrush = SelectObject(hdcmem, \r
+ marker[row][column] == 2 ? markerBrush : explodeBrush);\r
+ SquareToPos(row, column, &x, &y);\r
+ Ellipse(hdcmem, x + squareSize/4, y + squareSize/4,\r
+ x + 3*squareSize/4, y + 3*squareSize/4);\r
+ SelectObject(hdcmem, oldBrush);\r
+ }\r
+ }\r
+ }\r
if(logoHeight) {\r
HBITMAP whiteLogo = (HBITMAP) first.programLogo, blackLogo = (HBITMAP) second.programLogo;\r
if(appData.autoLogo) {\r
break;\r
\r
case WM_MOUSEMOVE:\r
+ MovePV(pt.x - boardRect.left, pt.y - boardRect.top, boardRect.bottom - boardRect.top);\r
if ((appData.animateDragging || appData.highlightDragging)\r
&& (wParam & MK_LBUTTON)\r
&& dragInfo.from.x >= 0) \r
}\r
break;\r
\r
+ case WM_MBUTTONUP:\r
+ case WM_RBUTTONUP:\r
+ ReleaseCapture();\r
+ UnLoadPV();\r
+ break;\r
+ \r
case WM_MBUTTONDOWN:\r
case WM_RBUTTONDOWN:\r
ErrorPopDown();\r
DrawPosition(TRUE, NULL);\r
\r
switch (gameMode) {\r
- case EditPosition:\r
case IcsExamining:\r
+ if(x < BOARD_LEFT || x >= BOARD_RGHT) break;\r
+ case EditPosition:\r
+ if (x == BOARD_LEFT-1 || x == BOARD_RGHT) break;\r
if (x < 0 || y < 0) break;\r
fromX = x;\r
fromY = y;\r
MenuPopup(hwnd, pt, LoadMenu(hInst, "ShogiPieceMenu"), -1);\r
}\r
break;\r
+ case IcsObserving:\r
+ if(!appData.icsEngineAnalyze) break;\r
case IcsPlayingWhite:\r
case IcsPlayingBlack:\r
- case EditGame:\r
+ if(!appData.zippyPlay) goto noZip;\r
case MachinePlaysWhite:\r
case MachinePlaysBlack:\r
- if (appData.testLegality &&\r
- gameInfo.variant != VariantBughouse &&\r
- gameInfo.variant != VariantCrazyhouse) break;\r
+ case TwoMachinesPlay:\r
+ case AnalyzeMode:\r
+ case AnalyzeFile:\r
+ if (!appData.dropMenu) {\r
+ SetCapture(hwndMain);\r
+ LoadPV(pt.x - boardRect.left, pt.y - boardRect.top);\r
+ break;\r
+ }\r
+ if(gameMode == TwoMachinesPlay || gameMode == AnalyzeMode ||\r
+ gameMode == AnalyzeFile || gameMode == IcsObserving) break;\r
+ case EditGame:\r
+ noZip:\r
if (x < 0 || y < 0) break;\r
+ if (!appData.dropMenu || appData.testLegality &&\r
+ gameInfo.variant != VariantBughouse &&\r
+ gameInfo.variant != VariantCrazyhouse) break;\r
fromX = x;\r
fromY = y;\r
hmenu = LoadMenu(hInst, "DropPieceMenu");\r