A Lion piece is added, and the roar sound and driver is added.
Put Mighty Lion in New Variant menu (WB)
Debug WB Mighty Lion
Fix dragging on second leg WB
Two-leg move animation WB
Add Lion .bmp files (WB)
}
-static int lastX, lastY, lastLeftX, lastLeftY, selectFlag, dragging;
+static int lastX, lastY, lastLeftX, lastLeftY, selectFlag;
+int dragging;
static ClickType lastClickType;
void
{
static int oldX = -1, oldY = -1, oldFromX = -1, oldFromY = -1;
int r, f;
- if(dragging == 2) DragPieceMove(xPix, yPix); // [HGM] lion: drag without button for second leg
if(!first.highlight) return;
if(fromX != oldFromX || fromY != oldFromY) oldX = oldY = -1; // kludge to fake entry on from-click
if(x == oldX && y == oldY) return; // only do something if we enter new square
return;
}
if(dragging == 2) { // [HGM] lion: just turn buttonless drag into normal drag, and let release to the job
- dragging = 1;
return;
}
if(x == killX && y == killY) { // second click on this square, which was selected as first-leg target
extern Boolean bookUp;
extern int tinyLayout, smallLayout;
extern Boolean mcMode;
+extern int dragging;
void MarkMenuItem P((char *menuRef, int state));
char *CmailMsg P((void));
} ColorClass;
typedef enum {
- SoundMove, SoundBell, SoundAlarm, SoundIcsWin, SoundIcsLoss,
+ SoundMove, SoundBell, SoundRoar, SoundAlarm, SoundIcsWin, SoundIcsLoss,
SoundIcsDraw, SoundIcsUnfinished, NSoundClasses
} SoundClass;
if(n == 0) { // motion
if(SeekGraphClick(Press, x, y, 1)) return NULL;
- if(but1 && !PromoScroll(x, y)) DragPieceMove(x, y);
+ if((but1 || dragging == 2) && !PromoScroll(x, y)) DragPieceMove(x, y);
if(but3) MovePV(x, y, lineGap + BOARD_HEIGHT * (squareSize + lineGap));
if(appData.highlightDragging) {
f = EventToSquare(x, BOARD_WIDTH); if ( flipView && f >= 0) f = BOARD_WIDTH - 1 - f;
#define BUILT_IN_SOUND_NAMES {\\r
"Beepbeep", "Ching", "Click", "Cymbal", "Ding", "Drip", \\r
"Gong", "Laser", "Move", "Penalty", "Phone", "Pop", "Pop2", \\r
- "Slap", "Squeak", "Swish", "Thud", "Whipcrack", \\r
+ "Roar", "Slap", "Squeak", "Swish", "Thud", "Whipcrack", \\r
"Alarm", "Challenge", "Channel", "Channel1", "Draw", "Kibitz", \\r
"Lose", "Request", "Seek", "Shout", "SShout", "Tell", "Unfinished", \\r
"Win", NULL \\r
}\r
\r
#define SETTINGS_FILE "winboard.ini"\r
-#define DEBUG_FILE "winboard.debug"
+#define DEBUG_FILE "winboard.debug"\r
\r
#define ICS_LOGON "ics.ini"\r
\r
#define OPT_VariantSpartan 1531\r
#define OPT_VariantASEAN 1532\r
#define OPT_VariantGrand 1534\r
+#define OPT_VariantLion 1535\r
#define OPT_EngineVariant 1560\r
#define IDC_Files 1550\r
#define IDC_Ranks 1551\r
int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY,\r
/*char*/int promoChar));\r
void DisplayMove P((int moveNumber));\r
-Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen));\r
void ChatPopUp P((char *s));\r
typedef struct {\r
ChessSquare piece; \r
&& (boardSize < SizePetite || boardSize > SizeBulky) // Archbishop and Chancellor available in entire middle range\r
|| (v == VariantShogi && boardSize != SizeModerate) // Japanese-style Shogi\r
|| v == VariantKnightmate || v == VariantSChess || v == VariantXiangqi || v == VariantSpartan\r
- || v == VariantShatranj || v == VariantMakruk || v == VariantGreat || v == VariantFairy ) {\r
+ || v == VariantShatranj || v == VariantMakruk || v == VariantGreat || v == VariantFairy || v == VariantLion ) {\r
if(boardSize < SizeMediocre) boardSize = SizePetite; else\r
if(boardSize > SizeModerate) boardSize = SizeBulky; else\r
boardSize = SizeMiddling;\r
pieceBitmap[0][WhiteUnicorn] = DoLoadBitmap(hInst, "u", squareSize, "s");\r
pieceBitmap[1][WhiteUnicorn] = DoLoadBitmap(hInst, "u", squareSize, "o");\r
pieceBitmap[2][WhiteUnicorn] = DoLoadBitmap(hInst, "u", squareSize, "w");\r
+ pieceBitmap[0][WhiteLion] = DoLoadBitmap(hInst, "ln", squareSize, "s");\r
+ pieceBitmap[1][WhiteLion] = DoLoadBitmap(hInst, "ln", squareSize, "o");\r
+ pieceBitmap[2][WhiteLion] = DoLoadBitmap(hInst, "ln", squareSize, "w");\r
\r
if(gameInfo.variant == VariantShogi) { /* promoted Gold represemtations */\r
pieceBitmap[0][WhiteCannon] = DoLoadBitmap(hInst, "wp", squareSize, "s");\r
\r
return result;\r
\r
+\r
+\r
}\r
\r
BOOL IsDrawArrowEnabled()\r
} else if (PtInRect((LPRECT) &blackRect, pt)) {\r
ClockClick(!flipClock); break;\r
}\r
+ if(dragging) { // [HGM] lion: don't destroy dragging info if we are already dragging\r
dragInfo.start.x = dragInfo.start.y = -1;\r
dragInfo.from = dragInfo.start;\r
+ }\r
if(fromX == -1 && frozen) { // not sure where this is for\r
fromX = fromY = -1; \r
DrawPosition(forceFullRepaint || FALSE, NULL); /* [AS] */\r
if(PromoScroll(pt.x - boardRect.left, pt.y - boardRect.top)) break;\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
+ && (wParam & MK_LBUTTON || dragging == 2)\r
&& dragInfo.from.x >= 0) \r
{\r
BOOL full_repaint = FALSE;\r
break;\r
\r
case IDM_Rematch:\r
+\r
RematchEvent();\r
break;\r
\r
SwapEngines(singleList); // temporarily swap first and second, to load a second 'first', ...\r
ParseArgs(StringGet, &p);\r
SwapEngines(singleList); // ... and then make it 'second'\r
+\r
appData.noChessProgram = FALSE;\r
appData.icsActive = FALSE;\r
} else if (IsDlgButtonChecked(hDlg, OPT_ChessServer)) {\r
histIn = (histIn + 1) % HISTORY_SIZE;\r
if (history[histIn] != NULL) {\r
free(history[histIn]);\r
+\r
history[histIn] = NULL;\r
}\r
histP = histIn;\r
}\r
\r
\r
+int\r
+Roar()\r
+{\r
+ MyPlaySound(&sounds[(int)SoundRoar]);\r
+ return 1;\r
+}\r
+\r
VOID\r
RingBell()\r
{\r
HDC hdc;\r
char *flag = blackFlag && gameMode == TwoMachinesPlay ? "(!)" : "";\r
\r
+\r
if(appData.noGUI) return;\r
hdc = GetDC(hwndMain);\r
if (!IsIconic(hwndMain)) {\r
int toY;\r
{\r
ChessSquare piece;\r
+ int x = toX, y = toY;\r
POINT start, finish, mid;\r
POINT frames[kFactor * 2 + 1];\r
int nFrames, n;\r
\r
+ if(killX >= 0 && IS_LION(board[fromY][fromX])) Roar();\r
+\r
if (!appData.animate) return;\r
if (doingSizing) return;\r
if (fromY < 0 || fromX < 0) return;\r
piece = board[fromY][fromX];\r
if (piece >= EmptySquare) return;\r
\r
+ if(killX >= 0) toX = killX, toY = killY; // [HGM] lion: first to kill square\r
+\r
+again:\r
+\r
ScreenSquare(fromX, fromY, &start);\r
ScreenSquare(toX, toY, &finish);\r
\r
}\r
animInfo.pos = finish;\r
DrawPosition(FALSE, NULL);\r
+\r
+ if(toX != x || toY != y) { fromX = toX; fromY = toY; toX = x; toY = y; goto again; } // second leg\r
+\r
animInfo.piece = EmptySquare;\r
Explode(board, fromX, fromY, toX, toY);\r
}\r
70,10\r
CONTROL "&atomic",OPT_VariantAtomic,"Button",BS_AUTORADIOBUTTON,\r
9,104,70,10\r
+ CONTROL "&Mighty Lion",OPT_VariantLion,"Button",BS_AUTORADIOBUTTON,\r
+ 9,114,70,10\r
CONTROL "cra&zyhouse",OPT_VariantCrazyhouse,"Button",BS_AUTORADIOBUTTON,80,14,\r
70,10\r
CONTROL "&bughouse",OPT_VariantBughouse,"Button",BS_AUTORADIOBUTTON,80,24,70,\r
S72O BITMAP MOVEABLE PURE "bitmaps/s72o.bmp"\r
L72O BITMAP MOVEABLE PURE "bitmaps/l72o.bmp"\r
DK72O BITMAP MOVEABLE PURE "bitmaps/dk72o.bmp"\r
+LN72O BITMAP MOVEABLE PURE "bitmaps/ln72o.bmp"\r
WP72O BITMAP MOVEABLE PURE "bitmaps/wp72o.bmp"\r
WN72O BITMAP MOVEABLE PURE "bitmaps/wn72o.bmp"\r
WL72O BITMAP MOVEABLE PURE "bitmaps/wl72o.bmp"\r
S72S BITMAP MOVEABLE PURE "bitmaps/s72s.bmp"\r
L72S BITMAP MOVEABLE PURE "bitmaps/l72s.bmp"\r
DK72S BITMAP MOVEABLE PURE "bitmaps/dk72s.bmp"\r
+LN72S BITMAP MOVEABLE PURE "bitmaps/ln72s.bmp"\r
WP72S BITMAP MOVEABLE PURE "bitmaps/wp72s.bmp"\r
WN72S BITMAP MOVEABLE PURE "bitmaps/wn72s.bmp"\r
WL72S BITMAP MOVEABLE PURE "bitmaps/wl72s.bmp"\r
S72W BITMAP MOVEABLE PURE "bitmaps/s72w.bmp"\r
L72W BITMAP MOVEABLE PURE "bitmaps/l72w.bmp"\r
DK72W BITMAP MOVEABLE PURE "bitmaps/dk72w.bmp"\r
+LN72W BITMAP MOVEABLE PURE "bitmaps/ln72w.bmp"\r
E49O BITMAP MOVEABLE PURE "bitmaps/e49o.bmp"\r
A49O BITMAP MOVEABLE PURE "bitmaps/a49o.bmp"\r
AA49O BITMAP MOVEABLE PURE "bitmaps/as49o.bmp"\r
S49O BITMAP MOVEABLE PURE "bitmaps/s49o.bmp"\r
L49O BITMAP MOVEABLE PURE "bitmaps/l49o.bmp"\r
DK49O BITMAP MOVEABLE PURE "bitmaps/dk49o.bmp"\r
+LN49O BITMAP MOVEABLE PURE "bitmaps/ln49o.bmp"\r
WP49O BITMAP MOVEABLE PURE "bitmaps/wp49o.bmp"\r
WN49O BITMAP MOVEABLE PURE "bitmaps/wn49o.bmp"\r
WL49O BITMAP MOVEABLE PURE "bitmaps/wl49o.bmp"\r
S49S BITMAP MOVEABLE PURE "bitmaps/s49s.bmp"\r
L49S BITMAP MOVEABLE PURE "bitmaps/l49s.bmp"\r
DK49S BITMAP MOVEABLE PURE "bitmaps/dk49s.bmp"\r
+LN49S BITMAP MOVEABLE PURE "bitmaps/ln49s.bmp"\r
WP49S BITMAP MOVEABLE PURE "bitmaps/wp49s.bmp"\r
WN49S BITMAP MOVEABLE PURE "bitmaps/wn49s.bmp"\r
WL49S BITMAP MOVEABLE PURE "bitmaps/wl49s.bmp"\r
S49W BITMAP MOVEABLE PURE "bitmaps/s49w.bmp"\r
L49W BITMAP MOVEABLE PURE "bitmaps/l49w.bmp"\r
DK49W BITMAP MOVEABLE PURE "bitmaps/dk49w.bmp"\r
+LN49W BITMAP MOVEABLE PURE "bitmaps/ln49w.bmp"\r
A33O BITMAP MOVEABLE PURE "bitmaps/a33o.bmp"\r
AA33O BITMAP MOVEABLE PURE "bitmaps/as33o.bmp"\r
C33O BITMAP MOVEABLE PURE "bitmaps/c33o.bmp"\r
M33O BITMAP MOVEABLE PURE "bitmaps/m33o.bmp"\r
O33O BITMAP MOVEABLE PURE "bitmaps/o33o.bmp"\r
DK33O BITMAP MOVEABLE PURE "bitmaps/dk33o.bmp"\r
+LN33O BITMAP MOVEABLE PURE "bitmaps/ln33o.bmp"\r
WP33O BITMAP MOVEABLE PURE "bitmaps/wp33o.bmp"\r
WN33O BITMAP MOVEABLE PURE "bitmaps/wn33o.bmp"\r
WL33O BITMAP MOVEABLE PURE "bitmaps/wl33o.bmp"\r
M33W BITMAP MOVEABLE PURE "bitmaps/m33w.bmp"\r
O33W BITMAP MOVEABLE PURE "bitmaps/o33w.bmp"\r
DK33W BITMAP MOVEABLE PURE "bitmaps/dk33w.bmp"\r
+LN33W BITMAP MOVEABLE PURE "bitmaps/ln33w.bmp"\r
A33S BITMAP MOVEABLE PURE "bitmaps/a33s.bmp"\r
AA33S BITMAP MOVEABLE PURE "bitmaps/as33s.bmp"\r
C33S BITMAP MOVEABLE PURE "bitmaps/c33s.bmp"\r
M33S BITMAP MOVEABLE PURE "bitmaps/m33s.bmp"\r
O33S BITMAP MOVEABLE PURE "bitmaps/o33s.bmp"\r
DK33S BITMAP MOVEABLE PURE "bitmaps/dk33s.bmp"\r
+LN33S BITMAP MOVEABLE PURE "bitmaps/ln33s.bmp"\r
WP33S BITMAP MOVEABLE PURE "bitmaps/wp33s.bmp"\r
WN33S BITMAP MOVEABLE PURE "bitmaps/wn33s.bmp"\r
WL33S BITMAP MOVEABLE PURE "bitmaps/wl33s.bmp"\r
TELL WAVE DISCARDABLE "sounds/tell.wav"\r
UNFINISHED WAVE DISCARDABLE "sounds/unfinished.wav"\r
WIN WAVE DISCARDABLE "sounds/win.wav"\r
+ROAR WAVE DISCARDABLE "sounds/roar.wav"\r
\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
-1,\r
-1,\r
OPT_VariantShogi,\r
+ -1, // Chu\r
OPT_VariantXiangqi,\r
OPT_VariantCourier,\r
OPT_VariantGothic,\r
OPT_VariantSChess,\r
OPT_VariantGrand,\r
OPT_VariantSpartan, // Spartan\r
+ OPT_VariantLion,\r
-2 // sentinel\r
};\r
\r
break;\r
\r
\r
+\r
+\r
case OPT_ChooseNormalColor:\r
ColorizeTextPopup(hDlg, ColorNormal);\r
UpdateSampleText(hDlg, OPT_SampleNormal, &mca[ColorNormal]);\r
SoundComboData soundComboData[] = {\r
{N_("Move"), NULL},\r
{N_("Bell"), NULL},\r
+ {N_("Roar"), NULL},\r
{N_("ICS Alarm"), NULL},\r
{N_("ICS Win"), NULL},\r
{N_("ICS Loss"), NULL},\r