RETSIGTYPE IntSigHandler P((int sig));
RETSIGTYPE TermSizeSigHandler P((int sig));
void CreateGCs P((int redo));
+void CreateAnyPieces P((void));
void CreateXIMPieces P((void));
void CreateXPMPieces P((void));
void CreateXPMBoard P((char *s, int n));
return forceMono;
}
+void
+CreateAnyPieces()
+{ // [HGM] taken out of main
+#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;
+
+ if (appData.bitmapDirectory[0] != NULLCHAR) {
+ CreatePieces();
+ } else {
+ CreateXPMPieces();
+ CreateXPMBoard(appData.liteBackTextureFile, 1);
+ CreateXPMBoard(appData.darkBackTextureFile, 0);
+ }
+#else
+ CreateXIMPieces();
+ /* Create regular pieces */
+ if (!useImages) CreatePieces();
+#endif
+}
+
int
main(argc, argv)
int argc;
if (forceMono) {
fprintf(stderr, _("%s: too few colors available; trying monochrome mode\n"),
programName);
-
- if (appData.bitmapDirectory == NULL ||
- appData.bitmapDirectory[0] == NULLCHAR)
- appData.bitmapDirectory = DEF_BITMAP_DIR;
+ appData.monoMode = True;
}
if (appData.lowTimeWarning && !appData.monoMode) {
CreateGCs(False);
CreateGrid();
-#if HAVE_LIBXPM
- if (appData.bitmapDirectory[0] != NULLCHAR) {
- CreatePieces();
- } else {
- CreateXPMPieces();
- CreateXPMBoard(appData.liteBackTextureFile, 1);
- CreateXPMBoard(appData.darkBackTextureFile, 0);
- }
-#else
- CreateXIMPieces();
- /* Create regular pieces */
- if (!useImages) CreatePieces();
-#endif
+ CreateAnyPieces();
CreatePieceMenus();
/* For XPM pieces, we need bitmaps to use as masks. */
if (useImages)
- CreateAnimMasks(info.depth);
- xpmDone = 1;
+ CreateAnimMasks(info.depth), xpmDone = 1;
}
#ifndef HAVE_USLEEP
static int oldCores, oldPonder;
int MakeColors P((void));
void CreateGCs P((int redo));
-void CreateXPMBoard P((char *s, int kind));
-void CreateXPMPieces P((void));
+void CreateAnyPieces P((void));
void GenericReadout();
Widget shells[10];
Widget marked[10];
void BoardOptionsOK(int n)
{
- extern int defaultLineGap;
+ extern int defaultLineGap, useImages, useImageSqs;
if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap; else lineGap = defaultLineGap;
+ useImages = useImageSqs = 0;
MakeColors(); CreateGCs(True);
- CreateXPMPieces();
- CreateXPMBoard(appData.liteBackTextureFile, 1);
- CreateXPMBoard(appData.darkBackTextureFile, 0);
+ CreateAnyPieces();
InitDrawingSizes(-1, 0);
DrawPosition(True, NULL);
}