* backend.c -- Common back end for X and Windows NT versions of
*
* Copyright 1991 by Digital Equipment Corporation, Maynard,
- * Massachusetts. Enhancements Copyright
- * 1992-2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software
- * Foundation, Inc.
+ * Massachusetts.
+ *
+ * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
+ * 2007, 2008, 2009 Free Software Foundation, Inc.
+ *
+ * Enhancements Copyright 2005 Alessandro Scotti
*
* The following terms apply to Digital Equipment Corporation's copyright
* interest in XBoard:
#endif
}
- if (moveNum > 0 && !gotPremove) {
+ if (moveNum > 0 && !gotPremove && !appData.noGUI) {
/* If move comes from a remote source, animate it. If it
isn't remote, it will have already been animated. */
if (!pausing && !ics_user_moved && prevMove == moveNum - 1) {
/* Display opponents and material strengths */
if (gameInfo.variant != VariantBughouse &&
- gameInfo.variant != VariantCrazyhouse) {
+ gameInfo.variant != VariantCrazyhouse && !appData.noGUI) {
if (tinyLayout || smallLayout) {
if(gameInfo.variant == VariantNormal)
sprintf(str, "%s(%d) %s(%d) {%d %d}",
/* Display the board */
- if (!pausing) {
+ if (!pausing && !appData.noGUI) {
if (appData.premove)
if (!gotPremove ||
/* [HGM] convert drag-and-drop piece drops to standard form */
if( fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) {
moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop;
- fromX = boards[currentMove][fromY][fromX];
+ if(appData.debugMode) fprintf(debugFP, "Drop move %d, curr=%d, x=%d,y=%d, p=%d\n",
+ moveType, currentMove, fromX, fromY, boards[currentMove][fromY][fromX]);
+// fromX = boards[currentMove][fromY][fromX];
+ // holdings might not be sent yet in ICS play; we have to figure out which piece belongs here
+ if(fromX == 0) fromY = BOARD_HEIGHT-1 - fromY; // black holdings upside-down
+ fromX = fromX ? WhitePawn : BlackPawn; // first piece type in selected holdings
+ while(PieceToChar(fromX) == '.' || PieceToNumber(fromX) != fromY && fromX != (int) EmptySquare) fromX++;
fromY = DROP_RANK;
}