int i;
static Dimension oldWidth, oldHeight;
static VariantClass oldVariant;
- static int oldDual = -1;
+ static int oldDual = -1, oldMono = -1;
if(!formWidget) return;
// [HGM] pieces: tailor piece bitmaps to needs of specific variant
// (only for xpm)
- if(gameInfo.variant == oldVariant) return; // and only if variant changed
+ if(gameInfo.variant != oldVariant) { // and only if variant changed
if(useImages) {
for(i=0; i<4; i++) {
}
}
}
+ }
#if HAVE_LIBXPM
+ if(appData.monoMode == oldMono)
CreateAnimVars();
#endif
+ oldMono = appData.monoMode;
}
#endif
#if HAVE_LIBXPM
if (appData.monoMode && // [HGM] no sense to go on to certain doom
(appData.bitmapDirectory == NULL || appData.bitmapDirectory[0] == NULLCHAR))
- appData.bitmapDirectory = DEF_BITMAP_DIR;
+ appData.bitmapDirectory = strdup(DEF_BITMAP_DIR);
if (appData.bitmapDirectory[0] != NULLCHAR) {
CreatePieces();
Widget CreateMenuBar(mb)
Menu *mb;
{
- int j;
+ int j, nChar=0, nr=0, boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap);
Widget anchor, menuBar;
Arg args[16];
char menuName[MSG_SIZ];
+ while(mb[nr].name != NULL) nChar += strlen(_(mb[nr++].name)) + 3;
+
j = 0;
XtSetArg(args[j], XtNorientation, XtorientHorizontal); j++;
XtSetArg(args[j], XtNvSpace, 0); j++;
}
else {
XtSetArg(args[j], XtNlabel, XtNewString(_(mb->name))); j++;
+ XtSetArg(args[j], XtNwidth, (boardWidth-40)*(strlen(_(mb->name)) + 3)/nChar); j++;
}
XtSetArg(args[j], XtNborderWidth, 0); j++;
}
}
if(!partnerUp && marker[row][column]) {
+ if(appData.monoMode) {
+ XFillArc(xDisplay, xBoardWindow, marker[row][column] == 2 ? darkSquareGC : lightSquareGC,
+ x + squareSize/4, y+squareSize/4, squareSize/2, squareSize/2, 0, 64*360);
+ XDrawArc(xDisplay, xBoardWindow, marker[row][column] == 2 ? lightSquareGC : darkSquareGC,
+ x + squareSize/4, y+squareSize/4, squareSize/2, squareSize/2, 0, 64*360);
+ } else
XFillArc(xDisplay, xBoardWindow, marker[row][column] == 2 ? prelineGC : highlineGC,
x + squareSize/4, y+squareSize/4, squareSize/2, squareSize/2, 0, 64*360);
}
/* Draw an arrow between two points using current settings */
void DrawArrowBetweenPoints( int s_x, int s_y, int d_x, int d_y )
{
- XPoint arrow[7];
+ XPoint arrow[8];
double dx, dy, j, k, x, y;
if( d_x == s_x ) {
}
XFillPolygon(xDisplay, xBoardWindow, highlineGC, arrow, 7, Nonconvex, CoordModeOrigin);
+ if(appData.monoMode) arrow[7] = arrow[0], XDrawLines(xDisplay, xBoardWindow, darkSquareGC, arrow, 8, CoordModeOrigin);
// Polygon( hdc, arrow, 7 );
}