VOID NewVariantPopup(HWND hwnd);\r
int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY,\r
/*char*/int promoChar));\r
-void AnimateAtomicCapture(int fromX, int fromY, int toX, int toY, int nFrames);\r
void DisplayMove P((int moveNumber));\r
Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen));\r
void ChatPopUp P((char *s));\r
HPALETTE hPal;\r
ColorClass currentColorClass;\r
\r
+static HWND savedHwnd;\r
HWND hCommPort = NULL; /* currently open comm port */\r
static HWND hwndPause; /* pause button */\r
static HBITMAP pieceBitmap[3][(int) BlackPawn]; /* [HGM] nr of bitmaps referred to bP in stead of wK */\r
OPT_VariantBughouse, OPT_VariantTwilight, OPT_VariantShogi, OPT_VariantSuper,\r
OPT_VariantKnightmate, OPT_VariantBerolina, OPT_VariantCylinder, OPT_VariantFairy,\r
OPT_VariantMakruk, OPT_VariantGothic, OPT_VariantCapablanca, OPT_VariantJanus,\r
- OPT_VariantCRC, OPT_VariantFalcon, OPT_VariantCourier, OPT_VariantGreat,\r
+ OPT_VariantCRC, OPT_VariantFalcon, OPT_VariantCourier, OPT_VariantGreat, OPT_VariantSChess,\r
OPT_VariantShatranj, OPT_VariantXiangqi, GPB_Variant, GPB_Board, IDC_Height,\r
IDC_Width, IDC_Hand, IDC_Pieces, IDC_Def }, \r
{ DLG_Fonts, IDOK, IDCANCEL, OPT_ChooseClockFont, OPT_ChooseMessageFont,\r
static int lastChecked;\r
static char oldLanguage[MSG_SIZ], *menuText[10][30];\r
extern int tinyLayout;\r
-extern char * menuBarText[][8];\r
+extern char * menuBarText[][10];\r
\r
void\r
LoadLanguageFile(char *name)\r
};\r
\r
int tinyLayout = 0, smallLayout = 0;\r
-#define MENU_BAR_ITEMS 7\r
+#define MENU_BAR_ITEMS 9\r
char *menuBarText[2][MENU_BAR_ITEMS+1] = {\r
- { N_("&File"), N_("&Mode"), N_("&Action"), N_("&Step"), N_("&Options"), N_("&Help"), NULL },\r
- { N_("&F"), N_("&M"), N_("&A"), N_("&S"), N_("&O"), N_("&H"), NULL },\r
+ { N_("&File"), N_("&Edit"), N_("&View"), N_("&Mode"), N_("&Action"), N_("E&ngine"), N_("&Options"), N_("&Help"), NULL },\r
+ { N_("&F"), N_("&E"), N_("&V"), N_("&M"), N_("&A"), N_("&N"), N_("&O"), N_("&H"), NULL },\r
};\r
\r
\r
pieceBitmap[1][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "o");\r
pieceBitmap[2][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "w");\r
} else { // Smirf-like\r
- pieceBitmap[0][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "s");\r
- pieceBitmap[1][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "o");\r
- pieceBitmap[2][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "w");\r
+ if(gameInfo.variant == VariantSChess) {\r
+ pieceBitmap[0][WhiteAngel] = DoLoadBitmap(hInst, "v", squareSize, "s");\r
+ pieceBitmap[1][WhiteAngel] = DoLoadBitmap(hInst, "v", squareSize, "o");\r
+ pieceBitmap[2][WhiteAngel] = DoLoadBitmap(hInst, "v", squareSize, "w");\r
+ } else {\r
+ pieceBitmap[0][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "s");\r
+ pieceBitmap[1][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "o");\r
+ pieceBitmap[2][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "w");\r
+ }\r
}\r
if(gameInfo.variant == VariantGothic) { // Vortex-like\r
pieceBitmap[0][WhiteMarshall] = DoLoadBitmap(hInst, "cv", squareSize, "s");\r
pieceBitmap[1][WhiteMarshall] = DoLoadBitmap(hInst, "cv", squareSize, "o");\r
pieceBitmap[2][WhiteMarshall] = DoLoadBitmap(hInst, "cv", squareSize, "w");\r
+ } else if(gameInfo.variant == VariantSChess && (squareSize == 49 || squareSize == 72)) {\r
+ pieceBitmap[0][WhiteMarshall] = DoLoadBitmap(hInst, "e", squareSize, "s");\r
+ pieceBitmap[1][WhiteMarshall] = DoLoadBitmap(hInst, "e", squareSize, "o");\r
+ pieceBitmap[2][WhiteMarshall] = DoLoadBitmap(hInst, "e", squareSize, "w");\r
} else { // WinBoard standard\r
pieceBitmap[0][WhiteMarshall] = DoLoadBitmap(hInst, "c", squareSize, "s");\r
pieceBitmap[1][WhiteMarshall] = DoLoadBitmap(hInst, "c", squareSize, "o");\r
if(--board[dragInfo.from.y][dragInfo.from.x-1] == 0 )\r
board[dragInfo.from.y][dragInfo.from.x] = EmptySquare;\r
} else \r
- board[dragInfo.from.y][dragInfo.from.x] = EmptySquare;\r
+ board[dragInfo.from.y][dragInfo.from.x] = gatingPiece;\r
}\r
\r
/* Figure out which squares need updating by comparing the \r
if(explodeInfo.radius) { // [HGM] atomic\r
HBRUSH oldBrush;\r
int x, y, r=(explodeInfo.radius * squareSize)/100;\r
+ ChessSquare piece = board[explodeInfo.fromY][explodeInfo.fromX];\r
board[explodeInfo.fromY][explodeInfo.fromX] = EmptySquare; // suppress display of capturer\r
SquareToPos(explodeInfo.toY, explodeInfo.toX, &x, &y);\r
x += squareSize/2;\r
DrawHighlightsOnDC(hdcmem, &highlightInfo, HIGHLIGHT_PEN);\r
DrawHighlightsOnDC(hdcmem, &premoveHighlightInfo, PREMOVE_PEN);\r
DrawBoardOnDC(hdcmem, board, tmphdc);\r
+ board[explodeInfo.fromY][explodeInfo.fromX] = piece;\r
oldBrush = SelectObject(hdcmem, explodeBrush);\r
Ellipse(hdcmem, x-r, y-r, x+r, y+r);\r
SelectObject(hdcmem, oldBrush);\r
ShowWindow(GetDlgItem(hDlg, PB_Bishop), \r
gameInfo.variant != VariantShogi ?\r
SW_SHOW : SW_HIDE);\r
- ShowWindow(GetDlgItem(hDlg, IDC_Yes), \r
- gameInfo.variant == VariantShogi ?\r
- SW_SHOW : SW_HIDE);\r
- ShowWindow(GetDlgItem(hDlg, IDC_No), \r
- gameInfo.variant == VariantShogi ?\r
- SW_SHOW : SW_HIDE);\r
+ if(gameInfo.variant == VariantShogi) {\r
+ SetDlgItemText(hDlg, PB_Queen, "YES");\r
+ SetDlgItemText(hDlg, PB_Knight, "NO");\r
+ SetWindowText(hDlg, "Promote?");\r
+ }\r
ShowWindow(GetDlgItem(hDlg, IDC_Centaur), \r
gameInfo.variant == VariantSuper ?\r
SW_SHOW : SW_HIDE);\r
break;\r
\r
case IDM_Match: // [HGM] match: flows into next case, after setting Match Mode and nr of Games\r
- if(gameMode != BeginningOfGame) break; // allow menu item to remain enabled for better mode highligting\r
+ if(gameMode != BeginningOfGame) { // allow menu item to remain enabled for better mode highligting\r
+ DisplayError(_("You can only start a match from the initial position."), 0); break;\r
+ }\r
matchMode = 2;// distinguish from command-line-triggered case (matchMode=1)\r
appData.matchGames = appData.defaultMatchGames;\r
matchGame = 1;\r
break;\r
\r
case IDM_Engine2Options:\r
+ savedHwnd = hwnd;\r
+ if(WaitForSecond(SettingsMenuIfReady)) break;\r
EngineOptionsPopup(hwnd, &second);\r
break;\r
\r
\r
if (fileName == NULL) fileName = buf1;\r
if (defName == NULL) {\r
- safeStrCpy(fileName, "*.", sizeof(fileName)/sizeof(fileName[0]) );\r
+ safeStrCpy(fileName, "*.", 3 );\r
strcat(fileName, defExt);\r
} else {\r
- safeStrCpy(fileName, defName, sizeof(fileName)/sizeof(fileName[0]) );\r
+ safeStrCpy(fileName, defName, MSG_SIZ );\r
}\r
- if (fileTitle) safeStrCpy(fileTitle, "", sizeof(fileTitle)/sizeof(fileTitle[0]) );\r
+ if (fileTitle) safeStrCpy(fileTitle, "", MSG_SIZ );\r
if (number) *number = 0;\r
\r
openFileName.lStructSize = sizeof(OPENFILENAME);\r
SendMessage(hwnd, EM_GETSELTEXT, 0, (LPARAM) name);\r
}\r
if (immediate) {\r
+ if(strstr(command, "%s")) snprintf(buf, MSG_SIZ, command, name); else\r
snprintf(buf, MSG_SIZ, "%s %s", command, name);\r
SetWindowText(hInput, buf);\r
SendMessage(hInput, WM_CHAR, '\r', 0);\r
POINT frames[], int * nFrames);\r
\r
\r
+#define kFactor 4\r
+\r
void\r
-AnimateAtomicCapture(int fromX, int fromY, int toX, int toY, int nFrames)\r
+AnimateAtomicCapture(Board board, int fromX, int fromY, int toX, int toY)\r
{ // [HGM] atomic: animate blast wave\r
int i;\r
-if(appData.debugMode) fprintf(debugFP, "exploding (%d,%d)\n", toX, toY);\r
+\r
explodeInfo.fromX = fromX;\r
explodeInfo.fromY = fromY;\r
explodeInfo.toX = toX;\r
explodeInfo.toY = toY;\r
- for(i=1; i<nFrames; i++) {\r
- explodeInfo.radius = (i*180)/(nFrames-1);\r
- DrawPosition(FALSE, NULL);\r
+ for(i=1; i<4*kFactor; i++) {\r
+ explodeInfo.radius = (i*180)/(4*kFactor-1);\r
+ DrawPosition(FALSE, board);\r
Sleep(appData.animSpeed);\r
}\r
explodeInfo.radius = 0;\r
- DrawPosition(TRUE, NULL);\r
+ DrawPosition(TRUE, board);\r
}\r
\r
-#define kFactor 4\r
-\r
void\r
AnimateMove(board, fromX, fromY, toX, toY)\r
Board board;\r
animInfo.pos = finish;\r
DrawPosition(FALSE, NULL);\r
animInfo.piece = EmptySquare;\r
- if(gameInfo.variant == VariantAtomic && \r
- (board[toY][toX] != EmptySquare || fromX != toX && (piece == WhitePawn || piece == BlackPawn) ) )\r
- AnimateAtomicCapture(fromX, fromY, toX, toY, 2*nFrames);\r
+ Explode(board, fromX, fromY, toX, toY);\r
}\r
\r
/* Convert board position to corner of screen rect and color */\r
\r
EvalGraphSet( first, last, current, pvInfoList );\r
}\r
+\r
+void\r
+SettingsPopUp(ChessProgramState *cps)\r
+{ // [HGM] wrapper needed because handles must not be passed through back-end\r
+ EngineOptionsPopup(savedHwnd, cps);\r
+}\r