- static Pixmap *images[] = {
- &left0, &left1, &right0, &right1,
- &left_front, &right_front, &front, &down
- };
- static unsigned char *bits[] = {
- nose_0_left_bits, nose_1_left_bits, nose_0_right_bits,
- nose_1_right_bits, nose_left_front_bits, nose_right_front_bits,
- nose_front_bits, nose_down_bits
- };
- int i;
-
- for (i = 0; i < sizeof (images) / sizeof (images[0]); i++)
+ Pixmap *images[8];
+#if defined(HAVE_GDK_PIXBUF) || defined(HAVE_XPM)
+ char **bits[8];
+#else
+ unsigned char *bits[8];
+#endif
+
+ int i = 0;
+ images[i++] = &st->left1;
+ images[i++] = &st->left2;
+ images[i++] = &st->right1;
+ images[i++] = &st->right2;
+ images[i++] = &st->left_front;
+ images[i++] = &st->right_front;
+ images[i++] = &st->front;
+ images[i] = &st->down;
+
+#if defined(HAVE_GDK_PIXBUF) || defined(HAVE_XPM)
+
+ i = 0;
+ bits[i++] = nose_l1_xpm;
+ bits[i++] = nose_l2_xpm;
+ bits[i++] = nose_r1_xpm;
+ bits[i++] = nose_r2_xpm;
+ bits[i++] = nose_f2_xpm;
+ bits[i++] = nose_f3_xpm;
+ bits[i++] = nose_f1_xpm;
+ bits[i] = nose_f4_xpm;
+
+ for (i = 0; i < sizeof (images) / sizeof(*images); i++)
+ {
+ Pixmap pixmap = xpm_data_to_pixmap (st->dpy, st->window, bits[i],
+ 0, 0, 0);
+ if (!pixmap)
+ {
+ fprintf (stderr, "%s: Can't load nose images\n", progname);
+ exit (1);
+ }
+ *images[i] = pixmap;
+ }
+#else
+ i = 0;
+ bits[i++] = nose_l1_bits;
+ bits[i++] = nose_l2_bits;
+ bits[i++] = nose_r1_bits;
+ bits[i++] = nose_r2_bits;
+ bits[i++] = nose_f2_bits;
+ bits[i++] = nose_f3_bits;
+ bits[i++] = nose_f1_bits;
+ bits[i++] = nose_f4_bits;
+
+ for (i = 0; i < sizeof (images) / sizeof(*images); i++)