home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume13 / jetpack / part02 / draw.c < prev    next >
C/C++ Source or Header  |  1992-04-10  |  17KB  |  580 lines

  1. /*    draw.c : routines that draw objects in the window
  2. */
  3.  
  4. #include "copyright.h"
  5. #include "defs.h"
  6.  
  7. Pixmap    drawpixmap;
  8.  
  9. char    fuelstring[20] = "Fuel: ";
  10. char    scorestring[30] = "Score: ";
  11. char    levelstring[40] = "Mazes Completed: ";
  12. char    bonusstring[30] = "Bonus: ";
  13.  
  14. int    oldscore = -1, oldlevel = -1;
  15.  
  16. int    titley = 130;
  17.  
  18. /*    draw draws all the objects in the window.
  19. */
  20. draw()
  21. {
  22. #ifdef    BLIT
  23.     XCopyArea(display, drawpixmap, gamewindow, ctable[CBLACK].smallgc,
  24.                 0, 0, WINDOWWIDTH, WINDOWHEIGHT, 0, 0);
  25.     XFillRectangle(display, drawpixmap, ctable[CBLACK].smallgc, 0, 0,
  26.                     WINDOWWIDTH, WINDOWHEIGHT);
  27. #else
  28.     erase_draw_zones();
  29.     init_zones();
  30. #endif
  31.  
  32.     draw_info();
  33.  
  34.     draw_player();
  35.     draw_maze();
  36.     draw_door();
  37.     draw_sweepers();
  38.     draw_treasures();
  39.     draw_fireballs();
  40.     draw_guards();
  41.     draw_messages();
  42. }
  43.  
  44. /*    draw_maze draws the lines of the maze that appear in the window
  45. */
  46. draw_maze()
  47. {
  48.     register int    i, x1, y1, x2, y2;
  49.  
  50.     for(i=0; i<mazelcount; i++) {
  51.         x1 = mazelines[i].x1 - plx + WINDOWWIDTH / 2;
  52.         y1 = mazelines[i].y1 - ply + WINDOWHEIGHT / 2;
  53.         x2 = mazelines[i].x2 - plx + WINDOWWIDTH / 2;
  54.         y2 = mazelines[i].y2 - ply + WINDOWHEIGHT / 2;
  55.         if(((x1 >= -EDGE) && (y1 >= -EDGE) && (x1 <= WINDOWWIDTH + EDGE) &&
  56.             (y1 <= WINDOWHEIGHT + EDGE)) || ((x2 >= -EDGE) && (y2 >= -EDGE)
  57.             && (x2 <= WINDOWWIDTH + EDGE) && (y2 <= WINDOWHEIGHT + EDGE))) {
  58.  
  59. #ifdef    BLIT
  60.                 XDrawLine(display, drawpixmap, ctable[CWHITE].smallgc,
  61.                             x1, y1, x2, y2);
  62. #else
  63.                 set_zone(x1, y1, x2, y2, ZLINE, i);
  64. #endif
  65.         }
  66.     }
  67. }
  68.  
  69. /*    draw_player draws the player in the center of the window
  70. */
  71. draw_player()
  72. {
  73.     if(dead) return;
  74.     if(exploded > -1) {
  75.  
  76. #ifdef    BLIT
  77.         XCopyArea(display, explodepix[exploded], drawpixmap,
  78.                     ctable[CWHITE].smallgc, 0, 0, EXPLODEWIDTH,
  79.                     EXPLODEHEIGHT, WINDOWWIDTH / 2 - EXPLODEWIDTH / 2,
  80.                     WINDOWHEIGHT / 2 - EXPLODEHEIGHT / 2);
  81. #else
  82.         set_zone(WINDOWWIDTH / 2 - EXPLODEWIDTH / 2, WINDOWHEIGHT / 2 -
  83.                     EXPLODEHEIGHT / 2, EXPLODEWIDTH, EXPLODEHEIGHT,
  84.                     ZEXPLODE, 0);
  85. #endif
  86.  
  87.     } else {
  88.  
  89. #ifdef    BLIT
  90.         XCopyArea(display, playerpix[playerphase], drawpixmap,
  91.                     ctable[CWHITE].smallgc, 0, 0, PLAYERWIDTH,
  92.                     PLAYERHEIGHT, WINDOWWIDTH / 2 - PLAYERWIDTH / 2,
  93.                     WINDOWHEIGHT / 2 - PLAYERHEIGHT / 2);
  94. #else
  95.         set_zone(WINDOWWIDTH / 2 - PLAYERWIDTH / 2, WINDOWHEIGHT / 2 -
  96.                     PLAYERHEIGHT / 2, PLAYERWIDTH, PLAYERHEIGHT,
  97.                     ZPLAYER, 0);
  98. #endif
  99.  
  100.         if(burn)
  101.  
  102. #ifdef    BLIT
  103.             XCopyArea(display, burnpix[playerphase / FACEFRONT],
  104.                             drawpixmap, ctable[CWHITE].smallgc, 0, 0,
  105.                             PLAYERWIDTH, PLAYERHEIGHT, WINDOWWIDTH / 2 -
  106.                             PLAYERWIDTH / 2, WINDOWHEIGHT / 2 -
  107.                             PLAYERHEIGHT / 2);
  108. #else
  109.         set_zone(WINDOWWIDTH / 2 - PLAYERWIDTH / 2, WINDOWHEIGHT / 2 -
  110.                     PLAYERHEIGHT / 2, PLAYERWIDTH, PLAYERHEIGHT,
  111.                     ZBURN, 0);
  112. #endif
  113.  
  114.     }
  115. }
  116.  
  117. /*    draw_fireballs draws all the fireballs in the window
  118. */
  119. draw_fireballs()
  120. {
  121.     register int    i, fx, fy;
  122.  
  123.     for(i=0; i<numfire; i++) {
  124.         fx = transx(firex[i], FIREWIDTH);
  125.         fy = transy(firey[i], FIREHEIGHT);
  126.         if((fx >= -FIREWIDTH - EDGE) && (fy >= -FIREHEIGHT - EDGE) &&
  127.             (fx <= WINDOWWIDTH + EDGE) && (fy <= WINDOWHEIGHT + EDGE)) {
  128.  
  129. #ifdef    BLIT
  130.             XCopyArea(display, firepix[firephase[i]], drawpixmap,
  131.                         ctable[CWHITE].smallgc, 0, 0, FIREWIDTH,
  132.                         FIREHEIGHT, fx, fy);
  133. #else
  134.             set_zone(fx, fy, FIREWIDTH, FIREHEIGHT, ZFIRE, i);
  135. #endif
  136.  
  137.         }
  138.     }
  139. }
  140.  
  141. /*    draw_guards draws all the guards in the window
  142. */
  143. draw_guards()
  144. {
  145.     register int    i, gx, gy;
  146.  
  147.     for(i=0; i<numguard; i++) {
  148.         gx = transx(guardx[i], GUARDWIDTH);
  149.         gy = transy(guardy[i], GUARDHEIGHT);
  150.         if((gx >= -GUARDWIDTH - EDGE) && (gy >= -GUARDHEIGHT - EDGE) &&
  151.             (gx <= WINDOWWIDTH + EDGE) && (gy <= WINDOWHEIGHT + EDGE)) {
  152.  
  153. #ifdef    BLIT
  154.             XCopyArea(display, guardpix[guarddir[i]][guardphase[i]],
  155.                         drawpixmap, ctable[CWHITE].smallgc, 0, 0,
  156.                         GUARDWIDTH, GUARDHEIGHT, gx, gy);
  157. #else
  158.             set_zone(gx, gy, GUARDWIDTH, GUARDHEIGHT, ZGUARD, i);
  159. #endif
  160.  
  161.         }
  162.     }
  163. }
  164.  
  165. /*    draw_sweepers draws all the sweepers in the window
  166. */
  167. draw_sweepers()
  168. {
  169.     register int    i, sx, sy;
  170.  
  171.     for(i=0; i<numsweep; i++) {
  172.         sx = transx(sweepx[i], SWEEPERWIDTH);
  173.         sy = transy(sweepy[i], SWEEPERHEIGHT);
  174.         if((sx >= -SWEEPERWIDTH - EDGE) && (sy >= -SWEEPERHEIGHT - EDGE) &&
  175.             (sx <= WINDOWWIDTH + EDGE) && (sy <= WINDOWHEIGHT + EDGE)) {
  176.  
  177. #ifdef    BLIT
  178.             XCopyArea(display, sweeperpix[sweepphase[i]], drawpixmap,
  179.                         ctable[CWHITE].smallgc, 0, 0, SWEEPERWIDTH,
  180.                         SWEEPERHEIGHT, sx, sy);
  181. #else
  182.             set_zone(sx, sy, SWEEPERWIDTH, SWEEPERHEIGHT, ZSWEEP, i);
  183. #endif
  184.  
  185.         }
  186.     }
  187. }
  188.  
  189. /*    draw_treasures draws the key and fuel pods in the window
  190. */
  191. draw_treasures()
  192. {
  193.     register int    i, tx, ty, width;
  194.  
  195.     for(i=0; i<numfuel; i++) {
  196.         if(fuelalive[i]) {
  197.             tx = transx(fuelx[i], FUELWIDTH);
  198.             ty = transy(fuely[i], FUELHEIGHT);
  199.             if((tx >= -FUELWIDTH - EDGE) && (ty >= -FUELHEIGHT - EDGE) &&
  200.                 (tx <= WINDOWWIDTH + EDGE) && (ty <= WINDOWHEIGHT + EDGE)) {
  201.  
  202. #ifdef    BLIT
  203.                 XCopyArea(display, fuelpix, drawpixmap,
  204.                             ctable[CWHITE].smallgc, 0, 0, FUELWIDTH,
  205.                             FUELHEIGHT, tx, ty);
  206. #else
  207.                 set_zone(tx, ty, FUELWIDTH, FUELHEIGHT, ZFUEL, i);
  208. #endif
  209.  
  210.             }
  211.         } else if(fueltimer[i]) {
  212.             tx = transx(fuelx[i], FUELWIDTH);
  213.             ty = transy(fuely[i], FUELHEIGHT);
  214.             width = XTextWidth(fontinfo,"100",3) / 2;
  215.  
  216. #ifdef    BLIT
  217.             XDrawString(display, drawpixmap,
  218.                         ctable[CGREEN].smallgc, tx + FUELWIDTH / 2
  219.                         - width, ty + FUELHEIGHT / 2,
  220.                         "100", 3);
  221. #else
  222.             set_zone(tx + FUELWIDTH / 2 - width, ty + FUELHEIGHT / 2 -
  223.                         fontinfo->ascent, width * 2, fontinfo->ascent +
  224.                         fontinfo->descent, ZFUEL, i);
  225. #endif
  226.  
  227.             fueltimer[i]--;
  228.         }
  229.     }
  230.     if(keyalive) {
  231.         tx = transx(keyx, KEYWIDTH);
  232.         ty = transy(keyy, KEYHEIGHT);
  233.         if((tx >= -KEYWIDTH - EDGE) && (ty >= -KEYHEIGHT - EDGE) &&
  234.             (tx <= WINDOWWIDTH + EDGE) && (ty <= WINDOWHEIGHT + EDGE)) {
  235.  
  236. #ifdef    BLIT
  237.             XCopyArea(display, keypix, drawpixmap,
  238.                         ctable[CWHITE].smallgc, 0, 0, KEYWIDTH,
  239.                         KEYHEIGHT, tx, ty);
  240. #else
  241.             set_zone(tx, ty, KEYWIDTH, KEYHEIGHT, ZKEY, 0);
  242. #endif
  243.  
  244.         }
  245.     } else if(keytimer) {
  246.         tx = transx(keyx, KEYWIDTH);
  247.         ty = transy(keyy, KEYHEIGHT);
  248.         width = XTextWidth(fontinfo,"500",3) / 2;
  249.  
  250. #ifdef    BLIT
  251.         XDrawString(display, drawpixmap, ctable[CGREEN].smallgc,
  252.                     tx + KEYWIDTH / 2 - width, ty + KEYHEIGHT / 2,
  253.                     "500", 3);
  254. #else
  255.         set_zone(tx + KEYWIDTH / 2 - width, ty + KEYHEIGHT / 2 -
  256.                     fontinfo->ascent, width * 2, fontinfo->ascent +
  257.                     fontinfo->descent, ZKEY, 0);
  258. #endif
  259.  
  260.         keytimer--;
  261.     }
  262. }
  263.  
  264. /*    draw_door draws the door in the window
  265. */
  266. draw_door()
  267. {
  268.     register int    dx, dy, phase;
  269.  
  270.     dx = transx(doorx, DOORWIDTH);
  271.     dy = transy(doory, DOORHEIGHT);
  272.     if((dx >= -DOORWIDTH - EDGE) && (dy >= -DOORHEIGHT - EDGE) &&
  273.         (dx <= WINDOWWIDTH + EDGE) && (dy <= WINDOWHEIGHT + EDGE)) {
  274.         phase = indoor;
  275.         if(indoor && (exploded > -1)) phase = 0;
  276.  
  277. #ifdef    BLIT
  278.         XCopyArea(display, doorpix[phase], drawpixmap,
  279.                     ctable[CWHITE].smallgc, 0, 0, DOORWIDTH,
  280.                     DOORHEIGHT, dx, dy - (DOORHEIGHT - PLAYERHEIGHT) / 2);
  281. #else
  282.         set_zone(dx, dy - (DOORHEIGHT - PLAYERHEIGHT) / 2, DOORWIDTH,
  283.                     DOORHEIGHT, ZDOOR, 0);
  284. #endif
  285.  
  286.     }
  287. }
  288.  
  289. /*    transx translates an x coordinate against the player's x coordinate to
  290.     fit it properly in the window.
  291. */
  292. int    transx(x, off)
  293. int    x, off;
  294. {
  295.     return(x - plx + WINDOWWIDTH / 2 - off / 2);
  296. }
  297.  
  298. /*    transy translates an y coordinate against the player's y coordinate to
  299.     fit it properly in the window.
  300. */
  301. int    transy(y, off)
  302. int    y, off;
  303. {
  304.     return(y - ply + WINDOWHEIGHT / 2 - off / 2);
  305. }
  306.  
  307. /*    refresh_info redraws the info window
  308. */
  309. refresh_info()
  310. {
  311.     register int    i;
  312.  
  313.     XClearWindow(display, infowindow);
  314.     if(!keyalive) XCopyArea(display, keypix, infowindow,
  315.                             ctable[CWHITE].smallgc, 0, 0, KEYWIDTH,
  316.                             KEYHEIGHT, WINDOWWIDTH / 2 - 10 - KEYWIDTH, 5);
  317.     for(i=0; i<men; i++) {
  318.         XCopyArea(display, extramanpix, infowindow, ctable[CWHITE].smallgc,
  319.                     0, 0, EXTRAMANWIDTH, EXTRAMANHEIGHT, WINDOWWIDTH - (i +
  320.                     1) * (EXTRAMANWIDTH + 3), 5);
  321.     }
  322.     if(gameover) XDrawString(display,infowindow, ctable[CRED].biggc,
  323.                                 100,30,"DEMO",strlen("DEMO"));
  324.     oldlevel = -1;
  325.     oldscore = -1;
  326.     draw_info();
  327. }
  328.  
  329. /*    draw_messages draws any active messages in the window
  330. */
  331. draw_messages()
  332. {
  333.     register int    tmpcolor;
  334.  
  335.     if(messagetime != 0) {
  336.  
  337. #ifdef    BLIT
  338.         if(messagecolor == CBLACK)
  339.             tmpcolor = random() % (NCOLORS-1) + 1;
  340.         else tmpcolor = messagecolor;
  341.         XDrawString(display, drawpixmap,
  342.                     ctable[tmpcolor].smallgc, messagex, messagey,
  343.                     messagestring, messagelength);
  344. #else
  345.         set_zone(messagex, messagey - fontinfo->ascent, messagewidth,
  346.                     fontinfo->ascent + fontinfo->descent, ZSMESS, 0);
  347. #endif
  348.  
  349.         messagetime--;
  350.     }
  351.     if(bigmessagetime != 0) {
  352.  
  353. #ifdef    BLIT
  354.         if(bigmessagecolor == CBLACK)
  355.             tmpcolor = random() % (NCOLORS-1) + 1;
  356.         else tmpcolor = bigmessagecolor;
  357.         XDrawString(display, drawpixmap,
  358.                     ctable[tmpcolor].biggc,
  359.                     bigmessagex, bigmessagey,
  360.                     bigmessagestring, bigmessagelength);
  361. #else
  362.         set_zone(bigmessagex, bigmessagey - bigfontinfo->ascent,
  363.                     bigmessagewidth, bigfontinfo->ascent +
  364.                     bigfontinfo->descent, ZBMESS, 0);
  365. #endif
  366.  
  367.         bigmessagetime--;
  368.     }
  369. }
  370.  
  371. /*    draw_info draws the stuff in the info window that needs to be updated
  372.     frequently
  373. */
  374. draw_info()
  375. {
  376.     int    tmp;
  377.  
  378.     sprintf(fuelstring, "Fuel: %04d", playerfuel);
  379.     if(playerfuel < 100) tmp = CRED;
  380.     else if(playerfuel < 500) tmp = CYELLOW;
  381.     else tmp = CGREEN;
  382.     XDrawImageString(display, infowindow, ctable[tmp].smallgc,
  383.                         10, 10, fuelstring, strlen(fuelstring));
  384.     if(level != oldlevel) {
  385.         sprintf(levelstring, "Level: %03d", level);
  386.         XDrawImageString(display, infowindow, ctable[CWHITE].smallgc,
  387.                             10, 20 + fontinfo->ascent + fontinfo->descent,
  388.                             levelstring, strlen(levelstring));
  389.         oldlevel = level;
  390.     }
  391.     sprintf(bonusstring, "Bonus: %06d", bonus);
  392.     XDrawImageString(display, infowindow, ctable[CWHITE].smallgc,
  393.                         WINDOWWIDTH / 2, 10, bonusstring,
  394.                         strlen(bonusstring));
  395.     if(score != oldscore) {
  396.         sprintf(scorestring, "Score: %09d", score);
  397.         XDrawImageString(display, infowindow, ctable[CWHITE].smallgc,
  398.                             WINDOWWIDTH / 2, 20 + fontinfo->ascent +
  399.                             fontinfo->descent, scorestring,
  400.                             strlen(scorestring));
  401.         oldscore = score;
  402.     }
  403. }
  404.  
  405. /*  place_string draws a centered string on the title screen
  406. */
  407. place_string(s, y, color, info)
  408. char        *s;
  409. int         y, color;
  410. XFontStruct *info;
  411. {
  412.     register int    length, width;
  413.  
  414.     length = strlen(s);
  415.     width = XTextWidth(info, s, length);
  416.  
  417. #ifdef  BLIT
  418.     if(info == bigfontinfo) {
  419.         XDrawString(display, drawpixmap, ctable[color].biggc,
  420.                     WINDOWWIDTH / 2 - width / 2, y, s, length);
  421.     } else {
  422.         XDrawString(display, drawpixmap, ctable[color].smallgc,
  423.                     WINDOWWIDTH / 2 - width / 2, y, s, length);
  424.     }
  425. #else
  426.     if(info == bigfontinfo) {
  427.         XDrawString(display, gamewindow, ctable[color].biggc,
  428.                     WINDOWWIDTH / 2 - width / 2, y, s, length);
  429.     } else {
  430.         XDrawString(display, gamewindow, ctable[color].smallgc,
  431.                     WINDOWWIDTH / 2 - width / 2, y, s, length);
  432.     }
  433. #endif
  434.  
  435. }
  436.  
  437. /*  title_draw updates and draws the title screen
  438. */
  439. title_draw()
  440. {
  441.     register int    i, j;
  442.  
  443.     update_fireballs();
  444.     update_sweepers();
  445.     update_guards();
  446.  
  447. #ifdef  BLIT
  448.     XFillRectangle(display, drawpixmap, ctable[CBLACK].smallgc, 0,
  449.                     titley, WINDOWWIDTH, WINDOWHEIGHT - titley);
  450.     XCopyArea(display, scorepixmap, drawpixmap, ctable[CWHITE].smallgc,
  451.                 0, 0, SCOREWIDTH, SCOREHEIGHT, SCOREX, SCOREY);
  452. #else
  453.     XCopyArea(display, scorepixmap, gamewindow, ctable[CBLACK].smallgc,
  454.                 0, 0, SCOREWIDTH, SCOREHEIGHT, SCOREX, SCOREY);
  455.     erase_draw_zones();
  456.     init_zones();
  457. #endif
  458.  
  459.     draw_maze();
  460.     draw_guards();
  461.     draw_sweepers();
  462.     draw_fireballs();
  463.     /*  make the player image do random things
  464.     */
  465.     if(random() % 30 == 0) burn = 1 - burn;
  466.     if(random() % 30 == 0) playerdir = random() % 3 - 1;
  467.     if(!burn && (playerdir != STOP)) {
  468.         playerphase += playerdir;
  469.         if(playerphase > FACERIGHT - 1) playerphase = FACEFRONT + 1;
  470.         if(playerphase < FACELEFT + 1) playerphase = FACEFRONT - 1;
  471.         if((playerdir == GOLEFT) && (playerphase < FACEFRONT))
  472.             playerphase = FACEFRONT;
  473.         if((playerdir == GORIGHT) && (playerphase > FACEFRONT))
  474.             playerphase = FACEFRONT;
  475.     } else playerphase = (playerdir+1) * FACEFRONT;
  476.  
  477. #ifdef  BLIT
  478.     XCopyArea(display, playerpix[playerphase], drawpixmap,
  479.                 ctable[CWHITE].smallgc, 0, 0, PLAYERWIDTH,
  480.                 PLAYERHEIGHT, WINDOWWIDTH / 2 - PLAYERWIDTH / 2, titley);
  481.     if(burn) XCopyArea(display, burnpix[playerphase / FACEFRONT],
  482.                         drawpixmap, ctable[CWHITE].smallgc, 0, 0,
  483.                         PLAYERWIDTH, PLAYERHEIGHT, WINDOWWIDTH / 2 -
  484.                         PLAYERWIDTH / 2, titley);
  485. #else
  486.     XFillRectangle(display, gamewindow, ctable[CBLACK].smallgc,
  487.                     WINDOWWIDTH / 2 - PLAYERWIDTH / 2, titley, PLAYERWIDTH,
  488.                     PLAYERHEIGHT);
  489.     XCopyArea(display, playerpix[playerphase], gamewindow,
  490.                 ctable[CWHITE].smallgc, 0, 0, PLAYERWIDTH,
  491.                 PLAYERHEIGHT, WINDOWWIDTH / 2 - PLAYERWIDTH / 2, titley);
  492.     if(burn) XCopyArea(display, burnpix[playerphase / FACEFRONT],
  493.                         gamewindow, ctable[CWHITE].smallgc, 0, 0,
  494.                         PLAYERWIDTH, PLAYERHEIGHT, WINDOWWIDTH / 2 -
  495.                         PLAYERWIDTH / 2, titley);
  496. #endif
  497. }
  498.  
  499. /*  title_refresh draws the title screen stuff that doesn't have to be
  500.     continuously updated
  501. */
  502. title_refresh()
  503. {
  504.     char            scstring[30];
  505.     register int    y, width;
  506.  
  507.     y = 5 + bigfontinfo->ascent;
  508.     place_string("Jetpack", y, CYELLOW, bigfontinfo);
  509.     y += bigfontinfo->descent + 5 + fontinfo->ascent;
  510.     place_string("By Mark Bradley", y, CBLUE, fontinfo);
  511.     y += fontinfo->descent + 5 + fontinfo->ascent;
  512.     place_string("Controls:", y, CWHITE, fontinfo);
  513.     y += fontinfo->descent + fontinfo->ascent;
  514.     place_string(
  515.         "  keypad 4, a, left button : move left                       ",
  516.         y, CGREEN, fontinfo);
  517.     place_string(
  518.         "                                           K : commit suicide",
  519.         y, CRED, fontinfo);
  520.     y += fontinfo->descent + fontinfo->ascent;
  521.     place_string(
  522.         " keypad 6, d, right button : move right                      ",
  523.         y, CGREEN, fontinfo);
  524.     place_string(
  525.         "                                           p : pause game    ",
  526.         y, CBLUE, fontinfo);
  527.     y += fontinfo->descent + fontinfo->ascent;
  528.     place_string(
  529.         "               keypad 5, s : stop                            ",
  530.         y, CRED, fontinfo);
  531.     place_string(
  532.         "                                           Q : quit game     ",
  533.         y, CGREY, fontinfo);
  534.     y += fontinfo->descent + fontinfo->ascent;
  535.     place_string(
  536.         "             center button : fire jetpack                    ",
  537.         y, CYELLOW, fontinfo);
  538.     y += fontinfo->descent + 10 + fontinfo->ascent;
  539.     place_string("Extra Player awarded every 10000 points", y, CGREY,
  540.                     fontinfo);
  541.  
  542. #ifdef  BLIT
  543.     XCopyArea(display, fuelpix, drawpixmap, ctable[CWHITE].smallgc,
  544.                 0, 0, FUELWIDTH, FUELHEIGHT, WINDOWWIDTH / 4 - FUELWIDTH /
  545.                2, 20 - FUELHEIGHT / 2);
  546.     XCopyArea(display, keypix, drawpixmap, ctable[CWHITE].smallgc,
  547.                 0, 0, KEYWIDTH, KEYHEIGHT, 3 * (WINDOWWIDTH / 4) -
  548.                 KEYWIDTH / 2, 20 - KEYHEIGHT / 2);
  549.     width = XTextWidth(fontinfo, "100", 3);
  550.     XDrawString(display, drawpixmap, ctable[CGREEN].smallgc,
  551.                 WINDOWWIDTH / 4 - width / 2, 20 + FUELHEIGHT / 2 + 5 +
  552.                 fontinfo->ascent, "100", 3);
  553.     width = XTextWidth(fontinfo, "500", 3);
  554.     XDrawString(display, drawpixmap, ctable[CGREEN].smallgc,
  555.                 3 * (WINDOWWIDTH / 4) - width / 2, 20 + KEYHEIGHT / 2 +
  556.                 10 + fontinfo->ascent, "500", 3);
  557. #else
  558.     XCopyArea(display, fuelpix, gamewindow, ctable[CWHITE].smallgc,
  559.                 0, 0, FUELWIDTH, FUELHEIGHT, WINDOWWIDTH / 4 - FUELWIDTH /
  560.                2, 20 - FUELHEIGHT / 2);
  561.     XCopyArea(display, keypix, gamewindow, ctable[CWHITE].smallgc,
  562.                 0, 0, KEYWIDTH, KEYHEIGHT, 3 * (WINDOWWIDTH / 4) -
  563.                 KEYWIDTH / 2, 20 - KEYHEIGHT / 2);
  564.     width = XTextWidth(fontinfo, "100", 3);
  565.     XDrawString(display, gamewindow, ctable[CGREEN].smallgc,
  566.                 WINDOWWIDTH / 4 - width / 2, 20 + FUELHEIGHT / 2 + 5 +
  567.                 fontinfo->ascent, "100", 3);
  568.     width = XTextWidth(fontinfo, "500", 3);
  569.     XDrawString(display, gamewindow, ctable[CGREEN].smallgc,
  570.                 3 * (WINDOWWIDTH / 4) - width / 2, 20 + KEYHEIGHT / 2 +
  571.                 10 + fontinfo->ascent, "500", 3);
  572. #endif
  573.  
  574.     sprintf(scstring, "Last Score: %09d", lastscore);
  575.     XDrawString(display, infowindow, ctable[CGREY].biggc,
  576.                 WINDOWWIDTH / 2 -
  577.                 XTextWidth(bigfontinfo, scstring, strlen(scstring)) / 2,
  578.                 INFOHEIGHT / 2, scstring, strlen(scstring));
  579. }
  580.