-#if defined(USE_PIXMAP)
- load_ghost_pixmaps (&display, window, &pp);
- load_pacman_pixmaps (&display, window, &pp);
-#else
- if ((pp->ghostPixmap[0][0][0] = XCreatePixmap (display, window,
- pp->spritexs, pp->spriteys,
- 1)) == None) {
- free_pacman (mi);
- return;
- }
-
- gcv.foreground = 0;
- gcv.background = 1;
- if ((bg_gc = XCreateGC (display, pp->ghostPixmap[0][0][0],
- GCForeground | GCBackground, &gcv)) == None) {
- free_pacman (mi);
- return;
- }
-
- gcv.foreground = 1;
- gcv.background = 0;
- if ((fg_gc = XCreateGC (display, pp->ghostPixmap[0][0][0],
- GCForeground | GCBackground, &gcv)) == None) {
- XFreeGC (display, bg_gc);
- free_pacman (mi);
- return;
- }
-
-#define SETPOINT(p, xp, yp) p.x = xp; p.y = yp
-
- /* draw the triangles on the bottom (scalable) */
- SETPOINT (points[0], 1, pp->spriteys * 5 / 6);
- SETPOINT (points[1], pp->spritexs / 6, pp->spriteys);
- SETPOINT (points[2], pp->spritexs / 3, pp->spriteys * 5 / 6);
- SETPOINT (points[3], pp->spritexs / 2, pp->spriteys);
- SETPOINT (points[4], pp->spritexs * 2 / 3, pp->spriteys * 5 / 6);
- SETPOINT (points[5], pp->spritexs * 5 / 6, pp->spriteys);
- SETPOINT (points[6], pp->spritexs, pp->spriteys * 5 / 6);
- SETPOINT (points[7], pp->spritexs, pp->spriteys / 2);
- SETPOINT (points[8], 1, pp->spriteys / 2);
-
- XFillRectangle (display, pp->ghostPixmap[0][0][0], bg_gc,
- 0, 0, pp->spritexs, pp->spriteys);
- XFillArc (display, pp->ghostPixmap[0][0][0], fg_gc,
- 0, 0, pp->spritexs, pp->spriteys, 0, 11520);
- XFillPolygon (display, pp->ghostPixmap[0][0][0], fg_gc,
- points, 9, Nonconvex, CoordModeOrigin);
- XFreeGC (display, bg_gc);
- XFreeGC (display, fg_gc);
-
-
- if (pp->pacmanPixmap[0][0] != None)
- for (dir = 0; dir < 4; dir++)
- for (mouth = 0; mouth < MAXMOUTH; mouth++)
- XFreePixmap (display, pp->pacmanPixmap[dir]
- [mouth]);
-
- for (dir = 0; dir < 4; dir++)
- for (mouth = 0; mouth < MAXMOUTH; mouth++) {
- if ((pp->pacmanPixmap[dir][mouth] =
- XCreatePixmap (display, MI_WINDOW (mi), pp->spritexs,
- pp->spriteys, 1)) == None) {
- free_pacman (mi);
- return;
- }
- gcv.foreground = 1;
- gcv.background = 0;
- if ((fg_gc = XCreateGC (display, pp->pacmanPixmap[dir][mouth],
- GCForeground | GCBackground,
- &gcv)) == None) {
- free_pacman (mi);
- return;
- }
- gcv.foreground = 0;
- gcv.background = 0;
- if ((bg_gc = XCreateGC (display,
- pp->pacmanPixmap[dir][mouth],
- GCForeground |
- GCBackground, &gcv)) == None) {
- XFreeGC (display, fg_gc);
- free_pacman (mi);
- return;
- }
- XFillRectangle (display,
- pp->pacmanPixmap[dir][mouth], bg_gc,
- 0, 0, pp->spritexs, pp->spriteys);
- if (pp->spritexs == 1 && pp->spriteys == 1)
- XFillRectangle (display,
- pp->pacmanPixmap[dir][mouth],
- fg_gc, 0, 0, pp->spritexs, pp->spriteys);
- else
- XFillArc (display,
- pp->pacmanPixmap[dir][mouth],
- fg_gc,
- 0, 0, pp->spritexs, pp->spriteys,
- ((90 - dir * 90) + mouth * 5) * 64,
- (360 + (-2 * mouth * 5)) * 64);
- XFreeGC (display, fg_gc);
- XFreeGC (display, bg_gc);
- }
-#endif /* USE_PIXMAP */