home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume18 / xmpb / part05 < prev    next >
Encoding:
Internet Message Format  |  1993-07-11  |  55.7 KB

  1. Path: uunet!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v18i005:  xmpb - multiplayer space combat for X, Part05/08
  5. Date: 26 Jun 1993 00:32:50 GMT
  6. Organization: Tektronix, Inc, Redmond, OR, USA
  7. Lines: 2152
  8. Approved: billr@saab.CNA.TEK.COM
  9. Message-ID: <20g5fi$6so@ying.cna.tek.com>
  10. NNTP-Posting-Host: saab.cna.tek.com
  11. Xref: uunet comp.sources.games:1795
  12.  
  13. Submitted-by: ddp@deakin.edu.au (Damien De Paoli)
  14. Posting-number: Volume 18, Issue 5
  15. Archive-name: xmpb/Part05
  16. Environment: X11, Xlib
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 5 (of 8)."
  27. # Contents:  Makefile.std junk.c npcc.man player.h shop_ui.c stats.c
  28. #   util.c xoutput.c
  29. # Wrapped by billr@saab on Fri Jun 25 16:30:15 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'Makefile.std' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'Makefile.std'\"
  33. else
  34. echo shar: Extracting \"'Makefile.std'\" \(8156 characters\)
  35. sed "s/^X//" >'Makefile.std' <<'END_OF_FILE'
  36. X.c.o:
  37. X    $(CC) -c $(CFLAGS) $*.c
  38. X
  39. X          INSTALL = install
  40. X               RM = rm -f
  41. X     INSTPGMFLAGS = -s -m 0755 -o bin -g bin
  42. X
  43. X     INSTBINFLAGS = -s -m 0755 -o bin -g bin
  44. X     INSTUIDFLAGS = -m 4755 -o root -g bin
  45. X     INSTLIBFLAGS = -m 0644 -o lib -g lib
  46. X     INSTINCFLAGS = -m 0644 -o inc -g inc
  47. X     INSTMANFLAGS = -m 0644 -o man -g man
  48. X     INSTDATFLAGS = -m 0644 -o lib -g lib
  49. X    INSTKMEMFLAGS = -m 2755 -o bin -g kmem
  50. X
  51. X      PROJECTROOT = /usr/X11R5
  52. X
  53. X     TOP_INCLUDES = -I$(INCROOT)
  54. X
  55. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  56. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  57. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  58. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  59. X
  60. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
  61. X
  62. X        USRLIBDIR = /usr/X11R5/lib
  63. X          INCROOT = /usr/X11R5/include
  64. X           INCDIR = $(INCROOT)/X11
  65. X           LIBDIR = $(USRLIBDIR)/X11
  66. X
  67. X  DEPEXTENSIONLIB =
  68. X     EXTENSIONLIB = -lXext
  69. X
  70. X          DEPXLIB = $(DEPEXTENSIONLIB)
  71. X             XLIB = $(EXTENSIONLIB) -lX11
  72. X
  73. X#
  74. X# Change these to change the installation targets
  75. X#
  76. X
  77. XBLASTDIR = /home/ddp/blast
  78. X
  79. XNPCDIR = $(BLASTDIR)/npc
  80. XBINDIR = $(BLASTDIR)/bin
  81. XSAVEDIR = $(BLASTDIR)/save
  82. XBITMAPDIR = $(BLASTDIR)/bitmaps
  83. X
  84. XMANSUFFIX = 6
  85. XMANDIR = $(BLASTDIR)/man/man$(MANSUFFIX)
  86. X
  87. XEXTRA_LOAD_FLAGS =
  88. XINSTALLMODS = 4755
  89. XYACC = yacc
  90. XLEX = lex
  91. X
  92. XINSTPGMFLAGS = -m $(INSTALLMODS) -o bin -g bin
  93. X
  94. X# If you have a NCD or HP, then remove the # on the next line
  95. X# NCDFLAG = -DNCD
  96. X
  97. X# Adjust if default is unsuitable
  98. XCC = cc
  99. X# Adjust for debugging or optimization relative to the default
  100. XCDEBUGFLAGS = -DBITMAPDIR="\"$(BITMAPDIR)/\"" -DSAVEDIR="\"$(SAVEDIR)/\"" -DNPCDIR="\"$(NPCDIR)/\"" $(NCDFLAG) -O2
  101. X
  102. X# Adjust if necessary
  103. XMATHLIB = -lm
  104. XMKDIRHIER = /usr/X11/bin/mkdirhier
  105. X
  106. X###############################
  107. X# Nothing to change below here
  108. X
  109. XSRCS = xoutput.c read_ship.c test.c disp_ship.c handle_ev.c add_host.c \
  110. X    update_win.c thrust.c ud_win.c do_stars.c radar.c stats.c weapon.c \
  111. X    error.c polygon.c damage_ship.c update_ships.c junk.c input.c \
  112. X    sintab.c costab.c calc_shields.c pcomp.c collide.c
  113. XOBJS = xoutput.o read_ship.o test.o disp_ship.o handle_ev.o add_host.o \
  114. X    update_win.o thrust.o ud_win.o do_stars.o radar.o stats.o weapon.o \
  115. X    error.o polygon.o damage_ship.o update_ships.o junk.o input.o \
  116. X    sintab.o costab.o calc_shields.o pcomp.o collide.o
  117. X
  118. XBMAPS = bitmaps/bigrock bitmaps/bomb bitmaps/cloud.1 bitmaps/cloud.2 \
  119. X    bitmaps/cloud.3 bitmaps/cloud.4 bitmaps/cloud.5 bitmaps/cloud.6 \
  120. X    bitmaps/debris.1 bitmaps/debris.2 bitmaps/debris.3 bitmaps/massdrive \
  121. X    bitmaps/medrock bitmaps/mine bitmaps/pulse bitmaps/rail \
  122. X    bitmaps/saturn1 bitmaps/seeker bitmaps/shortdeaddude bitmaps/smallrock \
  123. X    bitmaps/star1 bitmaps/star2 bitmaps/stipple bitmaps/atom bitmaps/hvypulse \
  124. X    bitmaps/magneto bitmaps/dunno bitmaps/dunno2
  125. X
  126. XNPCS = ml ml2  beam harry basic average nasty john rad1 rad2 rad3
  127. X
  128. XLOCAL_LIBRARIES = $(XLIB) $(MATHLIB)
  129. X
  130. Xall:: xmpb shop npcc retire describe clear_lock
  131. X
  132. X PROGRAM = xmpb
  133. X
  134. Xall:: xmpb
  135. X
  136. Xxmpb: $(OBJS) $(DEPLIBS)
  137. X    $(RM) $@
  138. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  139. X
  140. Xsaber_xmpb:: $(SRCS)
  141. X    # load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  142. X
  143. Xosaber_xmpb:: $(OBJS)
  144. X    # load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  145. X
  146. Xinstall:: xmpb
  147. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  148. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  149. X    $(INSTALL) -c $(INSTPGMFLAGS)  xmpb $(DESTDIR)$(BINDIR)
  150. X
  151. Xinstall.man:: xmpb.man
  152. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  153. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  154. X    $(INSTALL) -c $(INSTMANFLAGS) xmpb.man $(DESTDIR)$(MANDIR)/xmpb.$(MANSUFFIX)
  155. X
  156. Xdepend::
  157. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  158. X
  159. Xlint:
  160. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  161. Xlint1:
  162. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  163. X
  164. Xclean::
  165. X    $(RM) $(PROGRAM)
  166. X
  167. Xretire: retire.o save_load.o
  168. X    $(RM) $@
  169. X    $(CC) -o $@ retire.o save_load.o $(LDOPTIONS)  $(LDLIBS)  $(EXTRA_LOAD_FLAGS)
  170. X
  171. Xclean::
  172. X    $(RM) retire
  173. X
  174. Xdescribe: describe.o save_load.o
  175. X    $(RM) $@
  176. X    $(CC) -o $@ describe.o save_load.o $(LDOPTIONS)  $(LDLIBS)  $(EXTRA_LOAD_FLAGS)
  177. X
  178. Xclean::
  179. X    $(RM) describe
  180. X
  181. Xnpcc: lex.yy.o y.tab.o
  182. X    $(RM) $@
  183. X    $(CC) -o $@ lex.yy.o y.tab.o $(LDOPTIONS)  $(LDLIBS) -ll $(EXTRA_LOAD_FLAGS)
  184. X
  185. Xclean::
  186. X    $(RM) npcc
  187. X
  188. Xclear_lock: clear_lock.c save_load.o
  189. X    $(RM) $@
  190. X    $(CC) -o $@ clear_lock.c save_load.o $(LDOPTIONS)  $(LDLIBS)  $(EXTRA_LOAD_FLAGS)
  191. X
  192. Xclean::
  193. X    $(RM) clear_lock
  194. X
  195. Xshop: shop_ui.o shop_stubs.o save_load.o
  196. X    $(RM) $@
  197. X    $(CC) -o $@ shop_ui.o shop_stubs.o save_load.o $(LDOPTIONS) -L$(OPENWINHOME)/lib $(LDLIBS) -lxview -lolgx -lX11 $(EXTRA_LOAD_FLAGS)
  198. X
  199. Xclean::
  200. X    $(RM) shop
  201. X
  202. Xinstall:: shop
  203. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  204. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  205. X    $(INSTALL) -c $(INSTPGMFLAGS)  shop $(DESTDIR)$(BINDIR)
  206. X
  207. Xinstall:: retire
  208. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  209. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  210. X    $(INSTALL) -c $(INSTPGMFLAGS)  retire $(DESTDIR)$(BINDIR)
  211. X
  212. Xinstall:: describe
  213. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  214. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  215. X    $(INSTALL) -c $(INSTPGMFLAGS)  describe $(DESTDIR)$(BINDIR)
  216. X
  217. Xinstall:: npcc
  218. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  219. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  220. X    $(INSTALL) -c $(INSTPGMFLAGS)  npcc $(DESTDIR)$(BINDIR)
  221. X
  222. Xinstall.man:: retire.man
  223. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  224. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  225. X    $(INSTALL) -c $(INSTMANFLAGS) retire.man $(DESTDIR)$(MANDIR)/retire.$(MANSUFFIX)
  226. X
  227. Xinstall.man:: describe.man
  228. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  229. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  230. X    $(INSTALL) -c $(INSTMANFLAGS) describe.man $(DESTDIR)$(MANDIR)/describe.$(MANSUFFIX)
  231. X
  232. Xinstall.man:: shop.man
  233. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  234. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  235. X    $(INSTALL) -c $(INSTMANFLAGS) shop.man $(DESTDIR)$(MANDIR)/shop.$(MANSUFFIX)
  236. X
  237. Xinstall.man:: npcc.man
  238. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  239. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  240. X    $(INSTALL) -c $(INSTMANFLAGS) npcc.man $(DESTDIR)$(MANDIR)/npcc.$(MANSUFFIX)
  241. X
  242. Xinstall::
  243. X    @case '${MFLAGS}' in *[i]*) set +e;; esac;
  244. X    @for i in $(SAVEDIR) $(NPCDIR); do if [ -d $(DESTDIR)$$i ]; then \
  245. X    set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi \
  246. X    done
  247. X
  248. Xinstall:: $(BMAPS)
  249. X    @if [ -d $(DESTDIR)$(BITMAPDIR) ]; then set +x; \
  250. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BITMAPDIR)); fi
  251. X    @case '${MFLAGS}' in *[i]*) set +e;; esac; \
  252. X    for i in $(BMAPS); do \
  253. X    (set -x; $(INSTALL) -c -m 0644 $$i $(DESTDIR)$(BITMAPDIR)); \
  254. X    done
  255. X#
  256. X#
  257. X#    Rules for stuff imake doesn't know
  258. X#
  259. X
  260. Xlex.yy.o: lex.yy.c y.tab.c
  261. Xlex.yy.c: lex.l
  262. X    $(LEX) lex.l
  263. Xy.tab.c: parse.y
  264. X    $(YACC) -d parse.y
  265. Xclean::
  266. X    $(RM) lex.yy.c y.tab.c y.tab.h
  267. X
  268. Xnpcs::
  269. X    npcc $(NPCS)
  270. X
  271. Xinstall:: install.man
  272. X    cp shop.contents $(BITMAPDIR)
  273. X    chmod 644 $(BITMAPDIR)/shop.contents
  274. X    chmod 755 $(BLASTDIR)
  275. X    chmod 755 $(BINDIR)
  276. X    chmod 755 $(MANDIR)
  277. X    chmod 755 $(MANDIR)/..
  278. X    chmod 755 $(SAVEDIR)
  279. X    chmod 755 $(NPCDIR)
  280. X    chmod 700 $(BITMAPDIR)
  281. X
  282. Xinstall::
  283. X    npcc $(NPCS)
  284. X
  285. X# -------------------------------------------------------------------------
  286. X# common rules for all Makefiles - do not edit
  287. X
  288. Xemptyrule::
  289. X
  290. Xclean::
  291. X    $(RM_CMD) "#"*
  292. X
  293. XMakefile::
  294. X    -@if [ -f Makefile ]; then set -x; \
  295. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  296. X    else exit 0; fi
  297. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  298. X
  299. Xtags::
  300. X    $(TAGS) -w *.[ch]
  301. X    $(TAGS) -xw *.[ch] > TAGS
  302. X
  303. Xsaber:
  304. X    # load $(ALLDEFINES) $(SRCS)
  305. X
  306. Xosaber:
  307. X    # load $(ALLDEFINES) $(OBJS)
  308. X
  309. X# -------------------------------------------------------------------------
  310. X# empty rules for directories that do not have SUBDIRS - do not edit
  311. X
  312. Xinstall::
  313. X    @echo "install in $(CURRENT_DIR) done"
  314. X
  315. Xinstall.man::
  316. X    @echo "install.man in $(CURRENT_DIR) done"
  317. X
  318. XMakefiles::
  319. X
  320. Xincludes::
  321. X
  322. X# -------------------------------------------------------------------------
  323. X# dependencies generated by makedepend
  324. X
  325. END_OF_FILE
  326. if test 8156 -ne `wc -c <'Makefile.std'`; then
  327.     echo shar: \"'Makefile.std'\" unpacked with wrong size!
  328. fi
  329. # end of 'Makefile.std'
  330. fi
  331. if test -f 'junk.c' -a "${1}" != "-c" ; then 
  332.   echo shar: Will not clobber existing file \"'junk.c'\"
  333. else
  334. echo shar: Extracting \"'junk.c'\" \(4829 characters\)
  335. sed "s/^X//" >'junk.c' <<'END_OF_FILE'
  336. X/* junk.c - *** handle junk items */
  337. X
  338. Xstatic char sccs_id[] = "@(#)junk.c 1.10 93/03/26 ";
  339. X
  340. X#include "player.h"
  341. X
  342. Xextern int euid;
  343. Xextern winptr first_win;
  344. Xextern int installed;
  345. Xjunkptr first_junk = NULL;
  346. X
  347. X#define ABS(x)    ((x)<0?-(x):(x))
  348. X
  349. Xadd_junk(type,x,y,xv,yv,pic)
  350. Xint type,x,y,xv,yv,pic;
  351. X{
  352. X    junkptr j;
  353. X
  354. X    j = (junkptr) malloc(sizeof(struct junk_item));
  355. X
  356. X    if(!j)
  357. X        xmpb_error("Unable to alloc room for junk item\n");
  358. X
  359. X    j->type = type;
  360. X    j->sx = x;
  361. X    j->sy = y;
  362. X    j->xv = xv;
  363. X    j->yv = yv;
  364. X    j->pic = pic;
  365. X
  366. X    j->next = first_junk;
  367. X    first_junk = j;
  368. X}
  369. X
  370. Xfree_junk(j)
  371. Xjunkptr j;
  372. X{
  373. X    junkptr i;
  374. X
  375. X    i = first_junk;
  376. X    if(i==j)
  377. X    {
  378. X        first_junk = j->next;
  379. X        free(j);
  380. X    }
  381. X    else    
  382. X    {
  383. X        while(i->next)
  384. X        {
  385. X            if(j==i->next)
  386. X            {
  387. X                i->next = j->next;
  388. X                free(j);
  389. X                return;
  390. X            }
  391. X            i = i->next;
  392. X        }
  393. X        xmpb_error("Tried to free no-existent junk item\n");
  394. X    }
  395. X}
  396. X
  397. Xload_junkmaps(w)
  398. Xwinptr w;
  399. X{
  400. X    int xh,yh;
  401. X    int r;
  402. X    char *bitmapfile;
  403. X    char *bitmapfilestartptr;
  404. X
  405. X    /* Allocate a string to hold the bitmapfile's directory
  406. X       and the filename. "shortdeaddude" is the longest. */
  407. X    if(installed)
  408. X    {
  409. X        bitmapfile = (char *) malloc(strlen(BITMAPDIR)+strlen("shortdeaddude")+1);
  410. X        strcpy(bitmapfile,BITMAPDIR);
  411. X    }
  412. X    else
  413. X    {
  414. X        bitmapfile = (char *) malloc(10+strlen("shortdeaddude")+1);
  415. X        strcpy(bitmapfile,"./bitmaps/");
  416. X    }
  417. X
  418. X    /* Set a pointer to point into the start of the string where
  419. X       the filename will be added. Each time the filename will
  420. X       be overwritten with a new one. */
  421. X    if(installed)
  422. X        bitmapfilestartptr = bitmapfile + strlen(BITMAPDIR);
  423. X    else
  424. X        bitmapfilestartptr = bitmapfile + 10;
  425. X
  426. Xseteuid(euid);
  427. X    strcpy(bitmapfilestartptr,"shortdeaddude");
  428. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[DEADDUDE]), &(w->j_h[DEADDUDE]),&(w->junk_pm[DEADDUDE]),&xh,&yh);
  429. X    
  430. X    strcpy(bitmapfilestartptr,"bigrock");
  431. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[BIGROCK]), &(w->j_h[BIGROCK]),&(w->junk_pm[BIGROCK]),&xh,&yh);
  432. X
  433. X    strcpy(bitmapfilestartptr,"medrock");
  434. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[MEDROCK]), &(w->j_h[MEDROCK]),&(w->junk_pm[MEDROCK]),&xh,&yh);
  435. X
  436. X    strcpy(bitmapfilestartptr,"smallrock");
  437. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[SMALLROCK]), &(w->j_h[SMALLROCK]),&(w->junk_pm[SMALLROCK]),&xh,&yh);
  438. X
  439. X    strcpy(bitmapfilestartptr,"cloud.1");
  440. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[CLOUD1]), &(w->j_h[CLOUD1]),&(w->junk_pm[CLOUD1]),&xh,&yh);
  441. X
  442. X    strcpy(bitmapfilestartptr,"cloud.2");
  443. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[CLOUD2]), &(w->j_h[CLOUD2]),&(w->junk_pm[CLOUD2]),&xh,&yh);
  444. X
  445. X    strcpy(bitmapfilestartptr,"cloud.3");
  446. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[CLOUD3]), &(w->j_h[CLOUD3]),&(w->junk_pm[CLOUD3]),&xh,&yh);
  447. X
  448. X    strcpy(bitmapfilestartptr,"cloud.4");
  449. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[CLOUD4]), &(w->j_h[CLOUD4]),&(w->junk_pm[CLOUD4]),&xh,&yh);
  450. X
  451. X    strcpy(bitmapfilestartptr,"cloud.5");
  452. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[CLOUD5]), &(w->j_h[CLOUD5]),&(w->junk_pm[CLOUD5]),&xh,&yh);
  453. X
  454. X    strcpy(bitmapfilestartptr,"cloud.6");
  455. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[CLOUD6]), &(w->j_h[CLOUD6]),&(w->junk_pm[CLOUD6]),&xh,&yh);
  456. X
  457. X    strcpy(bitmapfilestartptr,"debris.1");
  458. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[DEBRIS1]), &(w->j_h[DEBRIS1]),&(w->junk_pm[DEBRIS1]),&xh,&yh);
  459. X
  460. X    strcpy(bitmapfilestartptr,"debris.2");
  461. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[DEBRIS2]), &(w->j_h[DEBRIS2]),&(w->junk_pm[DEBRIS2]),&xh,&yh);
  462. X
  463. X    strcpy(bitmapfilestartptr,"debris.3");
  464. X    r = XReadBitmapFile(w->theDisplay,w->theWindow,bitmapfile, &(w->j_w[DEBRIS3]), &(w->j_h[DEBRIS3]),&(w->junk_pm[DEBRIS3]),&xh,&yh);
  465. X
  466. X    free(bitmapfile);
  467. Xseteuid(getuid());
  468. X}
  469. X
  470. Xupdate_junk()
  471. X{
  472. X    junkptr j,k;
  473. X
  474. X    j = first_junk;
  475. X    while(j)
  476. X    {
  477. X        if(j->sx + j->xv/32000 < -WORLDW+50 || j->sx + j->xv/32000 > WORLDW-50)
  478. X        {
  479. X            j->xv = - j->xv;
  480. X        }
  481. X        if(j->sy + j->yv/32000 < -WORLDH+50 || j->sy + j->yv/32000 > WORLDH-50)
  482. X        {
  483. X            j->yv = - j->yv;
  484. X        }
  485. X        k = j->next;
  486. X
  487. X/*
  488. X    if(j->type < CLOUD1 || j->type > DEBRIS3)
  489. X        while(k)
  490. X        {    
  491. X            int q;
  492. X            if(ABS(j->sx - k->sx) < (first_win->j_w[j->type]+first_win->j_w[k->type])/2
  493. X                && (ABS(j->sy - k->sy) < (first_win->j_h[j->type]+first_win->j_h[k->type] )/2))
  494. X            {
  495. X                q = j->xv;
  496. X                j->xv = k->xv;
  497. X                k->xv = q;
  498. X                q = j->yv;
  499. X                j->yv = k->yv;
  500. X                k->yv = q;
  501. X            }    
  502. X            k=k->next;
  503. X        }
  504. X*/
  505. X        j->sx += j->xv/32000;
  506. X        j->sy += j->yv/32000;
  507. X        if(j->type >= CLOUD1 && j->type <= CLOUD6)
  508. X        {
  509. X            j->pic--;
  510. X            if(!j->pic)
  511. X            {
  512. X                j->type++;
  513. X                j->pic = 2;
  514. X            }
  515. X            if(j->type == CLOUD6+1)
  516. X            {
  517. X                junkptr z;
  518. X                z = j->next;
  519. X                free_junk(j);
  520. X                j = z;
  521. X            }
  522. X            else
  523. X                j = j->next;
  524. X        }
  525. X        else
  526. X            j = j->next;
  527. X    }
  528. X}
  529. END_OF_FILE
  530. if test 4829 -ne `wc -c <'junk.c'`; then
  531.     echo shar: \"'junk.c'\" unpacked with wrong size!
  532. fi
  533. # end of 'junk.c'
  534. fi
  535. if test -f 'npcc.man' -a "${1}" != "-c" ; then 
  536.   echo shar: Will not clobber existing file \"'npcc.man'\"
  537. else
  538. echo shar: Extracting \"'npcc.man'\" \(7457 characters\)
  539. sed "s/^X//" >'npcc.man' <<'END_OF_FILE'
  540. X.TH Xmpb
  541. X.SH NAME
  542. Xnpcc - NPC Compiler for Xmpb
  543. X.SH SYPNOSIS
  544. X.ta 4n
  545. X\fInpcc\fR Name
  546. X
  547. X.SH DESCRIPTION
  548. X
  549. XWriting your own NPC's with npcc.
  550. X
  551. X
  552. X    At the moment this is the only man page that is not even close to complete.  :^(  If you look in the section titled "The language", you need all the stuff from NPC to Jammer, Weapons and then any weapons you want.  Following this you need var (and end) with any global vars you need.  Then you can you used procedures and states.
  553. X    States are defined like this:
  554. X
  555. X.nf
  556. X    State blah
  557. X    {
  558. X        var 
  559. X           local
  560. X           vars
  561. X           are 
  562. X           optional
  563. X        end
  564. X    Entry  /* also optional, will be execute only once
  565. X    {      ** when the state is entered */
  566. X        /* Entry code */
  567. X    }
  568. X
  569. X         /* code that will continually be executed in this state */    
  570. X    }
  571. X
  572. X
  573. X    Procedures are defined as follows:
  574. X
  575. X    Procedure whatever
  576. X    {
  577. X        var
  578. X            locals /* again optional */
  579. X        end
  580. X    
  581. X    /* procedure code */
  582. X    return 1;  /* you must have a return.  It may or may not 
  583. X               ** return any value you wish */
  584. X    }
  585. X
  586. X    To call a procedure is just like in 'C' e.g.  whatever();
  587. X    To jump to a state use:   (condition==1) -> blah;
  588. X.fi
  589. X
  590. X    All other code is very 'C' like.  A good rule is if it gives you a syntax error (and it is 'C' like, then we didn't implement it.) 
  591. X
  592. X    My only other help for this is to look at the NPCs supplied.  Hopefully these will help you work out how to code an NPC.
  593. X
  594. X    Good luck :^)
  595. X
  596. X.SH 
  597. XThe language.
  598. X
  599. X.SH 
  600. XKeywords:
  601. X
  602. X.nf
  603. XNPC          Specify that this is an NPC file.  Must be the first line.
  604. XName         The Name of your NPC (e.g. Name = Idiot)
  605. XShip         The name of your ship (e.g. Ship = Boxhead)
  606. XEnergyMax    The maximum amount of energy your NPC's ship has
  607. XLShieldMax   The max Left Shield  (e.g. LShield = 600)
  608. XRShieldMax   The max Right Shield
  609. XBShieldMax   The max Bottom Shield
  610. XSolar        The quality of your Solar Panels  (e.g. Solar = 3)
  611. XShortRange   The quality of your Short Range Radar
  612. XEngine       The quality of your Engine
  613. XLongRange    The quality of your Long Range Radar
  614. XRepair       The quality of your Repair System
  615. XTC           The quality of your Targeting Computer
  616. XJammer       The quality of your Jamming Device
  617. Xnone         If you don't want your NPC to have an item, then use none.
  618. X             e.g. TC = none
  619. X
  620. XWeapons      Tells the compiler that that the weapon section follows
  621. XPulse        Pulse Rifle
  622. XBomb         Energy Bomb
  623. XSeek         Seeker (T)
  624. XLLaser       Light Laser
  625. XRail         Rail Gun
  626. XMass         Mass Driver
  627. XMine         Mine
  628. XAtom         Atomic Spray
  629. XHLaser       Heavy Laser
  630. XHPulse       Heavy Pulse
  631. XMagneto      Magneto Disc
  632. XBDeath       Black Death
  633. X
  634. Xvar          Tells the compiler that variables follow. Variables are all 
  635. X             integers.  There are global variables (after weapons) and 
  636. X             local vars (after State/Proc - described below)
  637. XState        Tells the compiler that a State declaration follows
  638. XEntry        Entry code that is executed once only when a state is entered
  639. XStart        Says which state the NPC should start at
  640. XProc         Used to define a procedure. 
  641. XIdle         Idle is used when checking what item is being repaired.  If 
  642. X             your repair system is idle, then it will return Idle
  643. Xreturn       used to return from a procedure, can be used to return values 
  644. X             like in C.  e.g. return 0;
  645. X.fi
  646. X
  647. X
  648. X.SH 
  649. XInput Ports.
  650. X
  651. XInput ports allow you to determine things about the state of your npc and 
  652. Xits environment. Input ports are use by simply calling the port and storing,
  653. Xor comparing the value:
  654. X
  655. X.nf
  656. X    e.g. num = NumEnemies;
  657. X         if (XPos > 0)  ...
  658. X.fi
  659. X
  660. XThe full list of the input ports and what they do:
  661. X
  662. X.nf
  663. XLShield            The current status of your Left Shield
  664. XRShield            The current status of your Right Shield
  665. XBShield            The current status of your Bottom Shield
  666. XRadarMode           The current mode of your radar (long or short)
  667. XXPos            The X Position of your ship
  668. XYPos               The Y Position of your ship
  669. XXVel            The X Velocity of your ship    
  670. XYVel            The Y Velocity of your ship
  671. XNumEnemies      The number of enemies left in the game
  672. XAngle           The Angle you are facing
  673. XSpeed           Your current Speed
  674. XEnemySpeed      The Speed of the current selected Enemy
  675. XEnemyDirection  The Bearing of the current selected Enemy
  676. XEnemyAngle      The Angle to the current selected Enemy
  677. XTargetState     The current state of your Targeting Computer
  678. XSolarState      The current state of your Solar Panels
  679. XJamState        The current state of your Jamming Device
  680. XShortState      The current state of your Short Range Radar
  681. XLongState       The current state of your Long Range Radar
  682. XEngineState     The current state of your Engine State
  683. XRepairState     The current state of your Repair System
  684. XCurrWeap        The current weapon that is selcted
  685. XEnemyDist       The distance to the currently selected enemy
  686. XEnergy          The current status of your Energy banks
  687. XEnemyAvail      If your current Enemy is available (ie. is still alive)
  688. XDirection       The current Direction of your travel
  689. XDistTo(x,y)     The Distance to a point (x,y)
  690. XAngleTo(x,y)    The Angle to a point (x,y)
  691. XEnemyXPos       The X Position of your Enemy
  692. XEnemyYPos       The Y Position of your Enemy
  693. XEnemyXVel       The X Velocity of your Enemy
  694. XEnemyYVel       The X Velocity of your Enemy
  695. XRepairItem      The current Item being Repaired
  696. XVelAtAngle      The velocity of your ship in the current direction you 
  697. X                are pointing
  698. XCurrWeapState   The state of the curr weap.  0 destroyed, 1 Okay.
  699. X.fi
  700. X
  701. X
  702. X.SH 
  703. XOutput Ports.
  704. X
  705. XOutput ports allow you to set things on your npc. They are used by
  706. Xsetting the appropriate port to the correct integer.
  707. X
  708. X.nf    
  709. X    e.g. set TurnTo = 90; /* turn to 90 degrees */ 
  710. X         set B1 =1;       /* turn on button 1 (or fire weapon) */
  711. X         set B1 =0;       /* turn off button 1 (or stop firing weapon) */
  712. X.fi
  713. X
  714. XThe full list of the output ports and what they do:
  715. X
  716. X.nf
  717. XB1                  Turn button 1 on (off) - fire weapon
  718. XB2                  Turn button 2 on (off) - change current weapon
  719. XB3                  Turn button 3 on (off) - turn thruseters on
  720. XBalance             Balances your shields
  721. XRadarChange         Change radar to short (or long) range
  722. XSelectEnemy         Select the current enemy to watch. There are up to 
  723. X                    (NumEnemies-1) enemies. 0 is the closest, 
  724. X                    (NumEnemies-1) is the farthest away
  725. XJamming             Turn on/off Jamming
  726. XGrab                Grab energy from your shields and put it into
  727. XShieldRegen         Turn on/off your shield regenerating
  728. XTurnLeft            Turn to the left     / Probably better to use
  729. XTurnRight           Turn to the right     \ TurnTo.
  730. XTurnTo              Set the angle to turn to (0-360 absolute angle)
  731. XTarget              Targeting computer to the selected enemy
  732. XRepairToggle        Toggle which item to repair
  733. XRepairSelectedItem  Repair a selected item, 
  734. X                    e.g. set RepairSelectedItem = Solar;
  735. XQuit                Quits (handy when you have a dead weapon, or no radars)
  736. X                    But of course 1/3 of your cash will go to the other npcs.
  737. X.fi
  738. X
  739. X.SH
  740. XBUGS AND LIMITATIONS
  741. X
  742. XOnly able to have 100 states/procs
  743. XOnly able to have 100 variables
  744. XOnly able to have 5000 lines of assembly
  745. X
  746. XBut all of these are configurable in the source code
  747. X
  748. X.SH SEE ALSO
  749. Xxmpb(6),npcc(6),shop(6),describe(6)
  750. END_OF_FILE
  751. if test 7457 -ne `wc -c <'npcc.man'`; then
  752.     echo shar: \"'npcc.man'\" unpacked with wrong size!
  753. fi
  754. # end of 'npcc.man'
  755. fi
  756. if test -f 'player.h' -a "${1}" != "-c" ; then 
  757.   echo shar: Will not clobber existing file \"'player.h'\"
  758. else
  759. echo shar: Extracting \"'player.h'\" \(5160 characters\)
  760. sed "s/^X//" >'player.h' <<'END_OF_FILE'
  761. X/* player.h - *** Main structure for the game */
  762. X
  763. X/*   @(#)player.h 1.33 92/11/24 XMPB  */
  764. X
  765. X#ifndef PLAYER_H
  766. X#define PLAYER_H
  767. X
  768. X#include <stdio.h>
  769. X#include <X11/Xlib.h>
  770. X#include <X11/Xutil.h>
  771. X#include <X11/cursorfont.h>
  772. X
  773. X#define PLAYW 650
  774. X#define PLAYH 650
  775. X#define WORLDH 5000
  776. X#define WORLDW 5000
  777. X#define STARSPERPLANE 10
  778. X#define MAXHOST 30
  779. X#define OFFSET 20
  780. X#define REPAIR_RATE 5.0
  781. X#define THRUST_E_USE 7
  782. X
  783. X#define EVENTMASK ButtonPressMask|ButtonReleaseMask|ExposureMask|KeyPressMask|KeyReleaseMask|EnterWindowMask|LeaveWindowMask|DestroyNotify
  784. X
  785. X#define RSH    1
  786. X#define LSH 2
  787. X#define BSH 3
  788. X
  789. X#define NUM_ITEMS 7
  790. X
  791. X#define SOLAR   0
  792. X#define SHORTRR 1
  793. X#define ENGINE  2
  794. X#define REPAIR  3
  795. X#define LONGRR  4
  796. X#define CLOAK   5
  797. X#define TC      6
  798. X#define IDLE    7
  799. X
  800. X#define SMALLROCK    0
  801. X#define MEDROCK        1
  802. X#define BIGROCK        2
  803. X#define DEADDUDE    3
  804. X#define CLOUD1        4
  805. X#define    CLOUD2        5
  806. X#define CLOUD3        6
  807. X#define CLOUD4        7
  808. X#define CLOUD5        8
  809. X#define CLOUD6        9
  810. X#define DEBRIS1        10
  811. X#define DEBRIS2        11
  812. X#define DEBRIS3        12
  813. X#define NO_JUNK_ITEMS 13
  814. X
  815. X#define RADSIZE 200
  816. X
  817. X#define MAX_NAME_SIZE 25
  818. Xstruct subwin
  819. X{
  820. X
  821. X        Display         *theDisplay;
  822. X        Window          theWindow;
  823. X        int             theScreen;
  824. X        int             thedepth;
  825. X        Cursor          theCursor;
  826. X        GC              theGC;
  827. X        unsigned long   theBlackPixel;
  828. X        unsigned long   theWhitePixel;
  829. X
  830. X};
  831. X
  832. Xtypedef struct subwin *subwinptr;
  833. X
  834. Xstruct ship_pic {
  835. X    int w,h;
  836. X    Pixmap pm;
  837. X    int xo,yo;
  838. X};
  839. Xstruct sPm
  840. X{
  841. X    Pixmap spm;
  842. X    int h,w;
  843. X};
  844. Xstruct stars 
  845. X{
  846. X    struct sPm *pm;
  847. X    int x,y;
  848. X    int lx,ly;
  849. X};
  850. X
  851. Xstruct keys {
  852. X        KeySym turnLeft, turnRight;
  853. X        KeySym toggleRadar, toggleShieldsRegen, toggleWeaponStatus;
  854. X        KeySym changeRepair, changeTarget, changeView;
  855. X        KeySym invisibility, quit, grabEnergy, balanceShields;
  856. X        KeySym fire, changeWeapon, thrust;
  857. X};
  858. X
  859. X#define WEAP_PULSE 0
  860. X#define WEAP_BOMB  1
  861. X#define WEAP_SEEK  2
  862. X#define WEAP_LIGHT_LASER 3
  863. X#define WEAP_RAIL 4
  864. X#define WEAP_MASS 5
  865. X#define WEAP_MINE 6
  866. X#define WEAP_HEAVY_LASER 7
  867. X#define WEAP_SPRAY 8
  868. X#define WEAP_MAGNET 9
  869. X#define WEAP_HVYPULSE 10
  870. X#define WEAP_BLACK 11
  871. X#define WEAP_DUNNO 12
  872. X#define WEAP_DUNNO2 13
  873. X#define WEAP_MISSILE 14
  874. X#define NO_WEAPONS 15
  875. X
  876. X
  877. Xstruct Weapon_Pixmap
  878. X{
  879. X    Pixmap thepm;
  880. X    int w,h;
  881. X};
  882. X
  883. Xtypedef struct Weapon_Pixmap Weapon_Pixmap;
  884. X
  885. X
  886. X
  887. Xstruct player
  888. X{
  889. X        int npc;
  890. X        int npcwin;
  891. X        Display         *theDisplay;
  892. X        Window          theWindow;
  893. X        int             theScreen;
  894. X        int             thedepth;
  895. X        Cursor          theCursor;
  896. X        GC              theGC;
  897. X        unsigned long   theBlackPixel;
  898. X        unsigned long   theWhitePixel;
  899. X        
  900. X        Pixmap back_buffer;
  901. X        GC bbgc,bbcleargc,bmgc,fillgc;
  902. X        GC jam25, jam50, jam75, jam100;
  903. X        GC blgc,aGC;
  904. X           XFontStruct    *xf; 
  905. X
  906. X        struct comp *comp;
  907. X
  908. X        struct player *next;
  909. X        struct player *prev;
  910. X        struct player *targeting;
  911. X        struct keys prefs;
  912. X        int x,y,w,h;
  913. X        int minw,maxw,minh,maxh;
  914. X        int b1,b2,b3,px,py;
  915. X        int tl,tr;
  916. X        int exploding, quitting;
  917. X        struct player * watching;
  918. X        int kills;
  919. X        int last_kills;
  920. X
  921. X        subwinptr radar;
  922. X        subwinptr stats;
  923. X        int short_range_radar;
  924. X        int angle_changed;
  925. X        long int xv,yv;
  926. X        int sx,sy,lx,ly;
  927. X        int thrust_power;
  928. X        /*float angle,max_angle_v;    */
  929. X        int angle, angle_v,max_angle_v;
  930. X        int max_accel;
  931. X        int dela;
  932. X        int pic,last_pic;
  933. X        char Name[MAX_NAME_SIZE],Ship[MAX_NAME_SIZE];
  934. X        char *title;
  935. X        char pass2[MAX_NAME_SIZE];
  936. X        char password[10];
  937. X        int hp_max, hp_curr;
  938. X        int ls_curr, ls_max, rs_curr, rs_max, bs_curr, bs_max;
  939. X        int shield_cnt;
  940. X        int lls,lrs,lbs,le;
  941. X        int energy_curr, energy_max;
  942. X        int credits, earned;   /* cash on hand and what earned */
  943. X        int rep_which;
  944. X        float rep_count;
  945. X        int shield_regen;
  946. X        int star;  /* state of the star when time is less than 1 min */
  947. X        int damaged;
  948. X
  949. X        char name[NUM_ITEMS+1][20];
  950. X        int quality[NUM_ITEMS+1];
  951. X        int state[NUM_ITEMS+1];
  952. X        int prob[NUM_ITEMS+1];
  953. X    
  954. X        struct ship_pic sp[24];
  955. X        struct ship_pic lt[24];
  956. X        struct ship_pic mt[24];
  957. X        struct ship_pic rt[24];
  958. X        struct sPm spm[5];
  959. X        struct stars stars1[STARSPERPLANE],stars2[STARSPERPLANE];
  960. X        char t1,t2,t3;  /* are the thrusters on */
  961. X        char lt1,lt2,lt3; /* were the thrusters on last frame */
  962. X
  963. X        int curr_weap;
  964. X        int does_have_weap[NO_WEAPONS];
  965. X        int load_status[NO_WEAPONS];
  966. X        int weap_on_status[NO_WEAPONS];
  967. X        int ship_value;
  968. X        int changed_last_frame;
  969. X        char cloaking;
  970. X
  971. X        Weapon_Pixmap weappms[NO_WEAPONS];
  972. X
  973. X        Pixmap junk_pm[NO_JUNK_ITEMS];        
  974. X        int j_w[NO_JUNK_ITEMS];
  975. X        int j_h[NO_JUNK_ITEMS];
  976. X
  977. X        /*
  978. X        *    The points for pre-calcing shield positions
  979. X        */
  980. X        int p1x,p1y;
  981. X        int p2x,p2y;
  982. X        int p3x,p3y;
  983. X};
  984. X
  985. Xtypedef struct player *winptr;
  986. X
  987. Xstruct laser
  988. X{
  989. X    int x1,y1,x2,y2,dam;
  990. X    winptr who;
  991. X    winptr hit_ship;
  992. X    double hit_dist;
  993. X    int hit_shield;
  994. X};
  995. X
  996. Xstruct weapon_item
  997. X{
  998. X    winptr who;
  999. X    winptr target;
  1000. X    int type;
  1001. X    int xv,yv;
  1002. X    int life,maxlife;
  1003. X    int angle;
  1004. X    int sx,sy;
  1005. X    struct weapon_item *next;
  1006. X};
  1007. X
  1008. Xstruct junk_item
  1009. X{
  1010. X    int type;
  1011. X    int pic;
  1012. X    int sx,sy;
  1013. X    int xv,yv;
  1014. X    struct junk_item *next;
  1015. X};
  1016. X
  1017. X
  1018. Xtypedef struct weapon_item *witemptr;
  1019. Xtypedef struct junk_item *junkptr;
  1020. X
  1021. Xwinptr xfe_open_window();
  1022. Xsubwinptr xfe_open_sub_window();
  1023. X
  1024. X#include "pcomp.h"
  1025. X
  1026. X#endif
  1027. END_OF_FILE
  1028. if test 5160 -ne `wc -c <'player.h'`; then
  1029.     echo shar: \"'player.h'\" unpacked with wrong size!
  1030. fi
  1031. # end of 'player.h'
  1032. fi
  1033. if test -f 'shop_ui.c' -a "${1}" != "-c" ; then 
  1034.   echo shar: Will not clobber existing file \"'shop_ui.c'\"
  1035. else
  1036. echo shar: Extracting \"'shop_ui.c'\" \(8228 characters\)
  1037. sed "s/^X//" >'shop_ui.c' <<'END_OF_FILE'
  1038. X#include <stdio.h>
  1039. X#include <sys/param.h>
  1040. X#include <sys/types.h>
  1041. X#include <xview/xview.h>
  1042. X#include <xview/canvas.h>
  1043. X#include <xview/icon_load.h>
  1044. X#include <xview/panel.h>
  1045. X#include <xview/scrollbar.h>
  1046. X#include <xview/svrimage.h>
  1047. X#include <xview/termsw.h>
  1048. X#include <xview/text.h>
  1049. X#include <xview/tty.h>
  1050. X#include <xview/xv_xrect.h>
  1051. X#include "shop_ui.h"
  1052. X
  1053. Xshort shop_bits[] = {
  1054. X#include "shop.icon"
  1055. X};
  1056. X
  1057. XXv_opaque
  1058. XMenu_create(ip, owner)
  1059. X    caddr_t        *ip;
  1060. X    Xv_opaque    owner;
  1061. X{
  1062. X    Xv_opaque    obj;
  1063. X    
  1064. X    obj = xv_create(XV_NULL, MENU_CHOICE_MENU,
  1065. X        XV_KEY_DATA, INSTANCE, ip,
  1066. X        MENU_GEN_PIN_WINDOW, (Xv_opaque) ip[0], curr->menu_name,
  1067. X        NULL);
  1068. X    curr->MenuPointer=obj;
  1069. X    return obj;
  1070. X}
  1071. X
  1072. XMainWinObjs *
  1073. XMainWinObjsInit(ip, owner)
  1074. X    MainWinObjs    *ip;
  1075. X    Xv_opaque    owner;
  1076. X{
  1077. X    if (!ip && !(ip = (MainWinObjs *) calloc(1, sizeof (MainWinObjs))))
  1078. X        return (MainWinObjs *) NULL;
  1079. X   if (!ip->Shop)
  1080. X        ip->Shop = MainWin_create(ip, owner);
  1081. X    if (!ip->controls1)
  1082. X        ip->controls1 = Controls1_create(ip, ip->Shop);
  1083. X    if (!ip->controls2)
  1084. X        ip->controls2 = Controls2_create(ip, ip->Shop);
  1085. X    if (!ip->canvas)
  1086. X        ip->canvas = Canvas_create(ip, ip->Shop);
  1087. X    if (!ip->BuyButton)
  1088. X        ip->BuyButton = BuyButton_create(ip, ip->controls2);
  1089. X    if (!ip->SellButton)
  1090. X        ip->SellButton = SellButton_create(ip, ip->controls2);
  1091. X    if (!ip->RepairButton)
  1092. X        ip->RepairButton = RepairButton_create(ip, ip->controls2);
  1093. X    if (!ip->ShowButton)
  1094. X        ip->ShowButton = ShowButton_create(ip, ip->controls2);
  1095. X    if (!ip->InShipLabel)
  1096. X        ip->InShipLabel = InShipLabel_create(ip, ip->controls1);
  1097. X      if (!ip->InShopLabel)
  1098. X        ip->InShopLabel = InShopLabel_create(ip, ip->controls1);
  1099. X    return ip;
  1100. X}
  1101. X
  1102. XXv_opaque
  1103. XMainWin_create(ip, owner)
  1104. X    caddr_t        ip;
  1105. X    Xv_opaque    owner;
  1106. X{
  1107. X    Xv_opaque    obj;
  1108. X    Server_image shop_image;
  1109. X    Icon    icon;
  1110. X    
  1111. X    obj = xv_create(owner, FRAME,
  1112. X        XV_KEY_DATA, INSTANCE, ip,
  1113. X        XV_WIDTH, 676,
  1114. X        XV_HEIGHT, 599,
  1115. X        XV_LABEL, "Shop",
  1116. X        FRAME_CLOSED, FALSE,
  1117. X        FRAME_SHOW_FOOTER, TRUE,
  1118. X        FRAME_SHOW_RESIZE_CORNER, TRUE,
  1119. X        NULL);
  1120. X    disp=(Display *)xv_get(obj, XV_DISPLAY);
  1121. X    gc=DefaultGC(disp, DefaultScreen(disp));
  1122. X    shop_image=(Server_image)xv_create(NULL, SERVER_IMAGE, XV_WIDTH, 64, XV_HEIGHT, 64, SERVER_IMAGE_BITS, shop_bits, NULL);
  1123. X    icon=(Icon)xv_create(obj, ICON, ICON_IMAGE, shop_image, XV_X, 100, XV_Y, 100, NULL);
  1124. X    xv_set(obj, FRAME_ICON, icon, NULL);
  1125. X    base=(Frame)obj;
  1126. X    return obj;
  1127. X}
  1128. X
  1129. XXv_opaque
  1130. XControls1_create(ip, owner)
  1131. X    caddr_t        ip;
  1132. X    Xv_opaque    owner;
  1133. X{
  1134. X    Xv_opaque    obj;
  1135. X    
  1136. X    obj = xv_create(owner, PANEL,
  1137. X        XV_KEY_DATA, INSTANCE, ip,
  1138. X        XV_X, 0,
  1139. X        XV_Y, 0,
  1140. X        XV_WIDTH, WIN_EXTEND_TO_EDGE,
  1141. X        XV_HEIGHT, 107,
  1142. X        WIN_BORDER, FALSE,
  1143. X        NULL);
  1144. X    return obj;
  1145. X}
  1146. X
  1147. XXv_opaque
  1148. XButton_create(ip, owner)
  1149. X    caddr_t        ip;
  1150. X    Xv_opaque    owner;
  1151. X{
  1152. X    Xv_opaque    obj;
  1153. X    
  1154. X    obj = xv_create(owner, PANEL_BUTTON,
  1155. X        XV_KEY_DATA, INSTANCE, ip,
  1156. X        XV_X, lastButtonPos,
  1157. X        XV_Y, ypos,
  1158. X        XV_WIDTH, 98,
  1159. X        XV_HEIGHT, 20,
  1160. X        PANEL_LABEL_STRING, curr->menu_name,
  1161. X        PANEL_ITEM_MENU, Menu_create((caddr_t *) ip, NULL),
  1162. X        NULL);
  1163. X    lastButtonPos += (int) xv_get(obj, XV_WIDTH, NULL) + 10;
  1164. X    if(lastButtonPos>600) {
  1165. X        lastButtonPos=10;
  1166. X        ypos=ypos+25;
  1167. X    }
  1168. X    
  1169. X    return obj;
  1170. X}
  1171. X
  1172. XXv_opaque
  1173. XCanvas_create(ip, owner)
  1174. X    caddr_t     ip;
  1175. X    Xv_opaque   owner;
  1176. X{
  1177. X    extern Notify_value Choose();
  1178. X    extern void DrawBits();
  1179. X    Xv_opaque   obj;
  1180. X
  1181. X    obj = xv_create(owner, CANVAS,
  1182. X        XV_KEY_DATA, INSTANCE, ip,
  1183. X        XV_X, 0,
  1184. X        XV_Y, 109,
  1185. X        XV_WIDTH, WIN_EXTEND_TO_EDGE,
  1186. X        XV_HEIGHT, 443,
  1187. X        CANVAS_REPAINT_PROC, DrawBits,
  1188. X        CANVAS_X_PAINT_WINDOW, TRUE,
  1189. X        NULL);
  1190. X    xv_set(canvas_paint_window(obj), WIN_CONSUME_EVENTS,
  1191. X        WIN_MOUSE_BUTTONS,
  1192. X        NULL, NULL);
  1193. X    notify_interpose_event_func(canvas_paint_window(obj),
  1194. X        (Notify_func) Choose, NOTIFY_SAFE);
  1195. X    xv_set(canvas_paint_window(obj), XV_KEY_DATA, INSTANCE, ip, NULL);
  1196. X    return obj;
  1197. X}
  1198. X
  1199. XXv_opaque
  1200. XControls2_create(ip, owner)
  1201. X    caddr_t        ip;
  1202. X    Xv_opaque    owner;
  1203. X{
  1204. X    Xv_opaque    obj;
  1205. X    
  1206. X    obj = xv_create(owner, PANEL,
  1207. X        XV_KEY_DATA, INSTANCE, ip,
  1208. X        XV_X, 0,
  1209. X        XV_Y, 552,
  1210. X        XV_WIDTH, WIN_EXTEND_TO_EDGE,
  1211. X        XV_HEIGHT, WIN_EXTEND_TO_EDGE,
  1212. X        WIN_BORDER, FALSE,
  1213. X        NULL);
  1214. X    return obj;
  1215. X}
  1216. X
  1217. XXv_opaque
  1218. XQuitButton_create(ip, owner, x, y)
  1219. X    caddr_t     ip;
  1220. X    Xv_opaque   owner;
  1221. X    int x,y;
  1222. X{
  1223. X    extern void     QuitPressed();
  1224. X    Xv_opaque   obj;
  1225. X
  1226. X    obj = xv_create(owner, PANEL_BUTTON,
  1227. X        XV_KEY_DATA, INSTANCE, ip,
  1228. X        XV_X, x,
  1229. X        XV_Y, y,
  1230. X        XV_WIDTH, 57,
  1231. X        XV_HEIGHT, 20,
  1232. X        PANEL_LABEL_STRING, "Quit",
  1233. X        PANEL_NOTIFY_PROC, QuitPressed,
  1234. X        NULL);
  1235. X    return obj;
  1236. X}
  1237. X
  1238. XXv_opaque
  1239. XBuyButton_create(ip, owner)
  1240. X    caddr_t        ip;
  1241. X    Xv_opaque    owner;
  1242. X{
  1243. X    extern void        BuyPressed();
  1244. X    Xv_opaque    obj;
  1245. X    
  1246. X    obj = xv_create(owner, PANEL_BUTTON,
  1247. X        XV_KEY_DATA, INSTANCE, ip,
  1248. X        XV_X, 125,
  1249. X        XV_Y, 25,
  1250. X        XV_WIDTH, 40,
  1251. X        XV_HEIGHT, 20,
  1252. X        PANEL_LABEL_STRING, "Buy",
  1253. X        PANEL_NOTIFY_PROC, BuyPressed,
  1254. X        NULL);
  1255. X    return obj;
  1256. X}
  1257. X
  1258. XXv_opaque
  1259. XSellButton_create(ip, owner)
  1260. X    caddr_t        ip;
  1261. X    Xv_opaque    owner;
  1262. X{
  1263. X    extern void        SellPressed();
  1264. X    Xv_opaque    obj;
  1265. X    
  1266. X    obj = xv_create(owner, PANEL_BUTTON,
  1267. X        XV_KEY_DATA, INSTANCE, ip,
  1268. X        XV_X, 470,
  1269. X        XV_Y, 25,
  1270. X        XV_WIDTH, 40,
  1271. X        XV_HEIGHT, 20,
  1272. X        PANEL_LABEL_STRING, "Sell",
  1273. X        PANEL_NOTIFY_PROC, SellPressed,
  1274. X        NULL);
  1275. X    return obj;
  1276. X}
  1277. X
  1278. XXv_opaque
  1279. XRepairButton_create(ip, owner)
  1280. X    caddr_t        ip;
  1281. X    Xv_opaque    owner;
  1282. X{
  1283. X    extern void        RepairPressed();
  1284. X    Xv_opaque    obj;
  1285. X    
  1286. X    obj = xv_create(owner, PANEL_BUTTON,
  1287. X        XV_KEY_DATA, INSTANCE, ip,
  1288. X        XV_X, 365,
  1289. X        XV_Y, 25,
  1290. X        XV_WIDTH, 57,
  1291. X        XV_HEIGHT, 20,
  1292. X        PANEL_LABEL_STRING, "Repair",
  1293. X        PANEL_NOTIFY_PROC, RepairPressed,
  1294. X        NULL);
  1295. X    return obj;
  1296. X}
  1297. X
  1298. X
  1299. XXv_opaque
  1300. XShowButton_create(ip, owner)
  1301. X    caddr_t        ip;
  1302. X    Xv_opaque    owner;
  1303. X{
  1304. X    extern void        TogglePressed();
  1305. X    Xv_opaque    obj;
  1306. X    
  1307. X    obj = xv_create(owner, PANEL_BUTTON,
  1308. X        XV_KEY_DATA, INSTANCE, ip,
  1309. X        XV_X, 550,
  1310. X        XV_Y, 25,
  1311. X        XV_WIDTH, 40,
  1312. X        XV_HEIGHT, 20,
  1313. X        PANEL_LABEL_STRING, "Show Weapons",
  1314. X        PANEL_NOTIFY_PROC, TogglePressed,
  1315. X        NULL);
  1316. X    return obj;
  1317. X}
  1318. X
  1319. XpwdWinObjs *
  1320. XpwdWinObjsInit(ip, owner)
  1321. X    pwdWinObjs    *ip;
  1322. X    Xv_opaque    owner;
  1323. X{
  1324. X    if (!ip && !(ip = (pwdWinObjs *) calloc(1, sizeof (pwdWinObjs))))
  1325. X        return (pwdWinObjs *) NULL;
  1326. X    if (!ip->pwdWin)
  1327. X        ip->pwdWin = pwdWin_create(ip, owner);
  1328. X    if (!ip->controls4)
  1329. X        ip->controls4 = Controls4_create(ip, ip->pwdWin);
  1330. X    if (!ip->pwdText)
  1331. X        ip->pwdText = pwdWinPwdText_create(ip, ip->controls4);
  1332. X    return ip;
  1333. X}
  1334. X
  1335. XXv_opaque
  1336. XpwdWin_create(ip, owner)
  1337. X    caddr_t        ip;
  1338. X    Xv_opaque    owner;
  1339. X{
  1340. X    Xv_opaque    obj;
  1341. X    
  1342. X    obj = xv_create(owner, FRAME_CMD,
  1343. X        XV_KEY_DATA, INSTANCE, ip,
  1344. X        XV_WIDTH, 400,
  1345. X        XV_HEIGHT, 150,
  1346. X        XV_LABEL, "Security Check!!!",
  1347. X        XV_SHOW, TRUE,
  1348. X        FRAME_SHOW_FOOTER, TRUE,
  1349. X        FRAME_SHOW_RESIZE_CORNER, FALSE,
  1350. X        FRAME_CMD_PUSHPIN_IN, FALSE,
  1351. X        NULL);
  1352. X    xv_set(xv_get(obj, FRAME_CMD_PANEL), WIN_SHOW, FALSE, NULL);
  1353. X    pwd=(Frame)obj;
  1354. X    return obj;
  1355. X}
  1356. X
  1357. XXv_opaque
  1358. XControls4_create(ip, owner)
  1359. X    caddr_t        ip;
  1360. X    Xv_opaque    owner;
  1361. X{
  1362. X    Xv_opaque    obj;
  1363. X    
  1364. X    obj = xv_create(owner, PANEL,
  1365. X        XV_KEY_DATA, INSTANCE, ip,
  1366. X        XV_X, 9,
  1367. X        XV_Y, 33,
  1368. X        XV_WIDTH, 383,
  1369. X        XV_HEIGHT, 111,
  1370. X        WIN_BORDER, FALSE,
  1371. X        NULL);
  1372. X    return obj;
  1373. X}
  1374. X
  1375. XXv_opaque
  1376. XpwdWinPwdText_create(ip, owner)
  1377. X    caddr_t        ip;
  1378. X    Xv_opaque    owner;
  1379. X{
  1380. X    extern Panel_setting    pwdnotify();
  1381. X    Xv_opaque    obj;
  1382. X    
  1383. X    obj = xv_create(owner, PANEL_TEXT,
  1384. X        XV_KEY_DATA, INSTANCE, ip,
  1385. X        XV_X, 40,
  1386. X        XV_Y, 40,
  1387. X        XV_WIDTH, 144,
  1388. X        XV_HEIGHT, 15,
  1389. X        PANEL_LABEL_STRING, "Password: ",
  1390. X        PANEL_VALUE_X, 120,
  1391. X        PANEL_VALUE_Y, 40,
  1392. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  1393. X        PANEL_VALUE_DISPLAY_LENGTH, 9,
  1394. X        PANEL_VALUE_STORED_LENGTH, 9,
  1395. X        PANEL_MASK_CHAR, TRUE,
  1396. X        PANEL_READ_ONLY, FALSE,
  1397. X        PANEL_NOTIFY_PROC, pwdnotify,
  1398. X        NULL);
  1399. X    return obj;
  1400. X}
  1401. X
  1402. X
  1403. XXv_opaque
  1404. XInShipLabel_create(ip, owner)
  1405. X    caddr_t     ip;
  1406. X    Xv_opaque   owner;
  1407. X{
  1408. X    Xv_opaque   obj;
  1409. X
  1410. X    obj = xv_create(owner, PANEL_MESSAGE,
  1411. X        XV_KEY_DATA, INSTANCE, ip,
  1412. X        XV_X, 360,
  1413. X        XV_Y, 90,
  1414. X        XV_WIDTH, 111,
  1415. X        XV_HEIGHT, 13,
  1416. X        PANEL_LABEL_STRING, "Items in your ship:",
  1417. X        PANEL_LABEL_BOLD, FALSE,
  1418. X        NULL);
  1419. X    return obj;
  1420. X}
  1421. X
  1422. XXv_opaque
  1423. XInShopLabel_create(ip, owner)
  1424. X    caddr_t     ip;
  1425. X    Xv_opaque   owner;
  1426. X{
  1427. X    Xv_opaque   obj;
  1428. X
  1429. X    obj = xv_create(owner, PANEL_MESSAGE,
  1430. X        XV_KEY_DATA, INSTANCE, ip,
  1431. X        XV_X, 10,
  1432. X        XV_Y, 90,
  1433. X        XV_WIDTH, 108,
  1434. X        XV_HEIGHT, 13,
  1435. X        PANEL_LABEL_STRING, "Items in the Shop:",
  1436. X        PANEL_LABEL_BOLD, FALSE,
  1437. X        NULL);
  1438. X    return obj;
  1439. X}
  1440. X
  1441. END_OF_FILE
  1442. if test 8228 -ne `wc -c <'shop_ui.c'`; then
  1443.     echo shar: \"'shop_ui.c'\" unpacked with wrong size!
  1444. fi
  1445. # end of 'shop_ui.c'
  1446. fi
  1447. if test -f 'stats.c' -a "${1}" != "-c" ; then 
  1448.   echo shar: Will not clobber existing file \"'stats.c'\"
  1449. else
  1450. echo shar: Extracting \"'stats.c'\" \(8423 characters\)
  1451. sed "s/^X//" >'stats.c' <<'END_OF_FILE'
  1452. X/* stats.c - ***  */
  1453. X
  1454. X#if !defined(lint)
  1455. Xstatic char sccs_id[] = "@(#)stats.c 1.25 93/06/03 XMPB";
  1456. X#endif
  1457. X#include "player.h"
  1458. X#define W            200
  1459. X#define H             25
  1460. X#define BAR1X         10
  1461. X#define BAR2X         230
  1462. X#define COL2        250
  1463. X#define STATUSOFFSET 160
  1464. X#define SHIELDL        20 
  1465. X#define SHIELDR        70 
  1466. X#define SHIELDB        120 
  1467. X#define HP             20
  1468. X#define ENERGY      170
  1469. X
  1470. Xextern weap_energy[NO_WEAPONS];
  1471. Xextern char weap_names[NO_WEAPONS][20];
  1472. Xextern int secs_left, mins_left;
  1473. Xbar_graph(w,max,curr,last,x,y,width,h)
  1474. Xwinptr w; 
  1475. Xint max,curr,*last,x,y,width,h;
  1476. X{
  1477. X    int scale;
  1478. X
  1479. X    scale = max/(width);
  1480. X
  1481. X    if(*last == -1)
  1482. X    {    
  1483. X        XDrawRectangle(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1484. X            x-1,y-1,width+1,h+1);
  1485. X        XFillRectangle(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1486. X            x,y,(width)*curr/max,h);
  1487. X        *last = curr;
  1488. X    }
  1489. X    else 
  1490. X    {
  1491. X        XClearArea(w->stats->theDisplay,w->stats->theWindow,x,y,width,h,False);
  1492. X        XFillRectangle(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1493. X            x,y,(width)*curr/max,h);
  1494. X        *last = curr;
  1495. X    }
  1496. X}
  1497. X
  1498. Xstatus(w,val,y)
  1499. Xwinptr w;
  1500. Xint val,y;
  1501. X{
  1502. X    char buf[MAX_NAME_SIZE];
  1503. X
  1504. X    if(val==-1)
  1505. X    {
  1506. X         XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1507. X            COL2+STATUSOFFSET,y,"N/A",strlen("N/A"));
  1508. X    }
  1509. X    else if(val==0) 
  1510. X    {
  1511. X        XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1512. X            COL2+STATUSOFFSET,y,"Destroyed",strlen("Destroyed"));
  1513. X    } 
  1514. X    else if(val<100)
  1515. X    {
  1516. X        sprintf(buf,"%d %% ",val);
  1517. X        XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1518. X            COL2+STATUSOFFSET,y,buf,strlen(buf));
  1519. X    }
  1520. X    else 
  1521. X    {
  1522. X        XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1523. X            COL2+STATUSOFFSET,y,"Okay",strlen("Okay"));
  1524. X    }
  1525. X}    
  1526. X
  1527. X    
  1528. Xdo_stats(w)
  1529. Xwinptr w;
  1530. X{
  1531. X
  1532. X    char buf[MAX_NAME_SIZE];
  1533. X    XEvent xe;
  1534. X    int i;
  1535. X
  1536. X    while(XCheckWindowEvent(w->stats->theDisplay,w->stats->theWindow,ExposureMask,&xe))
  1537. X    {
  1538. X        switch(xe.type)
  1539. X        {
  1540. X            case Expose:
  1541. X                w->lls = -1;    
  1542. X                w->lrs = -1;
  1543. X                w->lbs = -1;
  1544. X                w->le = -1;
  1545. X                sprintf(buf,"Name: %s",w->Name);
  1546. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1547. X                    COL2,20,buf,strlen(buf));
  1548. X                sprintf(buf,"Ship: %s",w->Ship);
  1549. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1550. X                    COL2,40,buf,strlen(buf));
  1551. X                sprintf(buf,"Credits: %d   ",w->credits);
  1552. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1553. X                    COL2,60,buf,strlen(buf));
  1554. X                XDrawLine(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1555. X                    COL2,250,470,250);     
  1556. X                XDrawLine(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1557. X                    COL2,253,470,253);     
  1558. X                XDrawLine(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1559. X                    COL2+140,230,COL2+140,405);     
  1560. X                XDrawLine(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1561. X                    COL2+143,230,COL2+143,405);     
  1562. X                sprintf(buf,"Hardware: ");
  1563. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1564. X                    COL2+10,245,buf,strlen(buf));
  1565. X                sprintf(buf,"Status: ");
  1566. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1567. X                    COL2+STATUSOFFSET,245,buf,strlen(buf));
  1568. X                XDrawLine(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1569. X                    0,207,480,207);     
  1570. X                XDrawLine(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1571. X                    240,0,240,415);     
  1572. X        {
  1573. X        char buf[40];
  1574. X        
  1575. X                sprintf(buf, "Left Shield (%d)", w->ls_max);
  1576. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1577. X                    BAR1X, SHIELDL-6,buf,strlen(buf));
  1578. X                sprintf(buf, "Right Shield (%d)", w->rs_max);
  1579. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1580. X                    BAR1X, SHIELDR-6,buf,strlen(buf));
  1581. X                sprintf(buf, "Bottom Shield (%d)", w->bs_max);
  1582. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1583. X                    BAR1X, SHIELDB-6,buf,strlen(buf));
  1584. X                sprintf(buf, "Energy (%d)", w->energy_max);
  1585. X                XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1586. X                    BAR1X, ENERGY-6,buf,strlen(buf));
  1587. X        }
  1588. X                for(i=0; i < NUM_ITEMS; i++) {
  1589. X                    sprintf(buf,"%s (%d)",w->name[i],w->quality[i]);
  1590. X                    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,
  1591. X                      w->stats->theGC, COL2+10,270+20*i,buf,strlen(buf));
  1592. X                    status(w,w->state[i],270+20*i);
  1593. X                }
  1594. X                break;
  1595. X            default:
  1596. X                break;
  1597. X        }
  1598. X    }
  1599. X
  1600. X    /* top left */
  1601. X    /* KLUDGE ALERTT!!!! */
  1602. X    if(w->energy_curr<0) w->energy_curr=0;
  1603. X    if(w->lls!=w->ls_curr) 
  1604. X        bar_graph(w,w->ls_max, w->ls_curr, &w->lls,BAR1X, SHIELDL, W, H);
  1605. X    if(w->lrs!=w->rs_curr) 
  1606. X        bar_graph(w,w->rs_max, w->rs_curr, &w->lrs,BAR1X, SHIELDR, W, H);
  1607. X    if(w->lbs!=w->bs_curr) 
  1608. X        bar_graph(w,w->bs_max, w->bs_curr, &w->lbs,BAR1X, SHIELDB, W, H);
  1609. X    if(w->le!=w->energy_curr) 
  1610. X        bar_graph(w,w->energy_max, w->energy_curr, &w->le,BAR1X, ENERGY, W, H);
  1611. X
  1612. X    /* top right */
  1613. X
  1614. X    sprintf(buf,"Earned: %d Credits",w->earned);
  1615. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1616. X        COL2,80,buf,strlen(buf));
  1617. X
  1618. X    sprintf(buf,"Kills: %d",w->kills);
  1619. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1620. X        COL2,100,buf,strlen(buf));
  1621. X
  1622. X    sprintf(buf,"Value: %d",w->ship_value);
  1623. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1624. X        COL2,120,buf,strlen(buf));
  1625. X
  1626. X    if(secs_left>=59)
  1627. X        sprintf(buf,"Time Left: %d mins  ", mins_left);
  1628. X    else
  1629. X    {
  1630. X        if(w->star)
  1631. X        {
  1632. X            sprintf(buf,"* Time Left: %d secs  ", secs_left);
  1633. X            w->star=0;
  1634. X        }
  1635. X        else
  1636. X        {
  1637. X            sprintf(buf,"  Time Left: %d secs", secs_left);
  1638. X            w->star=1;
  1639. X        }
  1640. X    }
  1641. X    if(!w->npcwin)
  1642. X        XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1643. X        COL2,140,buf,strlen(buf));
  1644. X    else
  1645. X        XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1646. X        COL2,180,buf,strlen(buf));
  1647. X
  1648. Xif(w->npc)
  1649. X{
  1650. X    for(i=1;i<w->comp->no_states;i++)
  1651. X    {
  1652. X        if(w->comp->pc < w->comp->stp[i])
  1653. X            break;
  1654. X    }
  1655. X    sprintf(buf,"State: %20s",w->comp->states[i-1]);
  1656. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1657. X        COL2,140,buf,strlen(buf));
  1658. X
  1659. X    if(w->comp->ce)
  1660. X        sprintf(buf,"Enemy: %20s",w->comp->ce->Name);
  1661. X    else
  1662. X        sprintf(buf,"Enemy: %20s","None");
  1663. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1664. X        COL2,160,buf,strlen(buf));
  1665. X}
  1666. X    /* bottom left */
  1667. X
  1668. X/* show the weapon name */    
  1669. X    if(w->curr_weap != -1)
  1670. X    {
  1671. X        sprintf(buf,"Weapon: %s      ",weap_names[w->curr_weap]);
  1672. X    }
  1673. X    else
  1674. X        sprintf(buf,"Weapon: None               ");
  1675. X    
  1676. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1677. X        BAR1X,230,buf,strlen(buf));
  1678. X
  1679. X/* update the display of the current weapon  */
  1680. Xif(w->curr_weap != -1)
  1681. X{
  1682. X    sprintf(buf,"Status: ");
  1683. X    if(w->weap_on_status[w->curr_weap] == 0)
  1684. X        strcat(buf,"Off      ");
  1685. X    else if(w->load_status[w->curr_weap] > 0)
  1686. X        strcat(buf,"Loading  ");
  1687. X    else if(w->load_status[w->curr_weap] == 0)
  1688. X        strcat(buf,"Ready    ");
  1689. X    else 
  1690. X        strcat(buf,"Destroyed");
  1691. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1692. X        BAR1X,250,buf,strlen(buf));
  1693. X
  1694. X    sprintf(buf,"Weapon Energy Usage: %d ",weap_energy[w->curr_weap]);
  1695. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1696. X        BAR1X,270,buf,strlen(buf));
  1697. X}
  1698. X
  1699. Xif(w->state[REPAIR]>0) {
  1700. X    sprintf(buf,"Repair: %s",w->name[w->rep_which]);
  1701. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1702. X        BAR1X,290,buf,strlen(buf));
  1703. X}
  1704. X
  1705. X    /* KLUDGE ALERT!!! spacing here is not on */
  1706. Xif(w->state[TC]>0) {
  1707. X    if (w->targeting)
  1708. X        sprintf(buf,"Targeting: %-20s",w->targeting->Name);
  1709. X    else
  1710. X        sprintf(buf,"Targeting: %-20s", "Off");
  1711. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1712. X        BAR1X,310,buf,strlen(buf));
  1713. X}
  1714. X
  1715. X    sprintf(buf,"Shields Regenerating: ");
  1716. X    if(w->shield_regen)
  1717. X        strcat(buf,"True ");
  1718. X    else
  1719. X        strcat(buf,"False");
  1720. X    XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1721. X        BAR1X,330,buf,strlen(buf));
  1722. Xif(w->state[CLOAK]>0) {
  1723. X    sprintf(buf,"Jamming: ");
  1724. X    if(w->cloaking)
  1725. X        strcat(buf,"On ");
  1726. X    else
  1727. X        strcat(buf,"Off");
  1728. X     XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1729. X        BAR1X,350,buf,strlen(buf));
  1730. X}
  1731. X
  1732. X    /* bottom right */
  1733. Xif(w->damaged || w->rep_which!=IDLE) {
  1734. X    for(i=0; i < NUM_ITEMS; i++) { 
  1735. X        sprintf(buf,"%s (%d)",w->name[i],w->quality[i]);
  1736. X        XDrawImageString(w->stats->theDisplay,w->stats->theWindow,w->stats->theGC,
  1737. X            COL2+10,270+20*i,buf,strlen(buf));
  1738. X        status(w,w->state[i],270+20*i);
  1739. X    }
  1740. X    w->damaged=0;
  1741. X}
  1742. X
  1743. X    XFlush(w->stats->theDisplay);
  1744. X
  1745. X}
  1746. END_OF_FILE
  1747. if test 8423 -ne `wc -c <'stats.c'`; then
  1748.     echo shar: \"'stats.c'\" unpacked with wrong size!
  1749. fi
  1750. # end of 'stats.c'
  1751. fi
  1752. if test -f 'util.c' -a "${1}" != "-c" ; then 
  1753.   echo shar: Will not clobber existing file \"'util.c'\"
  1754. else
  1755. echo shar: Extracting \"'util.c'\" \(2759 characters\)
  1756. sed "s/^X//" >'util.c' <<'END_OF_FILE'
  1757. X#include "player.h"
  1758. X#include "save.h"
  1759. X#include "weapon.h"
  1760. X
  1761. Xint val(i)
  1762. Xint i;
  1763. X{
  1764. X    if(i==-1)
  1765. X        return 1;
  1766. X    if(i >=1 && i <=9)
  1767. X        return 1;
  1768. X    return 0;
  1769. X}
  1770. X
  1771. Xint euid;
  1772. X
  1773. Xmain(argc, argv)
  1774. Xint argc;
  1775. Xchar *argv[];
  1776. X{
  1777. X    save *dude;
  1778. X    extern save default_save;
  1779. X    char s[100];
  1780. X    int i;
  1781. X
  1782. X    if(argc!=2) 
  1783. X    {
  1784. X        printf("Usage: %s Name\n", argv[0]);
  1785. X        exit(1);
  1786. X    }
  1787. X    euid=geteuid();
  1788. X    dude=load_dude(argv[1]);
  1789. X    printf("Change Name to (%s): ", dude->Name);
  1790. X    gets(s);
  1791. X    if(strlen(s))
  1792. X        strcpy(dude->Name,s);
  1793. X    printf("Change Ship to (%s): ", dude->Ship);
  1794. X    gets(s);
  1795. X    if(strlen(s))
  1796. X        strcpy(dude->Ship,s);
  1797. X    printf("Change Password to (%s): ", dude->password);
  1798. X    gets(s);
  1799. X    if(strlen(s))
  1800. X        strcpy(dude->password,s);
  1801. X    printf("Engine Quality (-1 == none, curr =%d): ", dude->quality[ENGINE]);
  1802. X    gets(s);
  1803. X    i=atoi(s);
  1804. X    if(val(i) && strlen(s))
  1805. X    {
  1806. X        dude->quality[ENGINE]=i;
  1807. X        dude->state[ENGINE]=100;
  1808. X    }
  1809. X    printf("Solar Quality (-1 == none, curr =%d): ", dude->quality[SOLAR]);
  1810. X    gets(s);
  1811. X    i=atoi(s);
  1812. X    if(val(i) && strlen(s))
  1813. X    {
  1814. X        dude->quality[SOLAR]=i;
  1815. X        dude->state[SOLAR]=100;
  1816. X    }
  1817. X    printf("Long Range Radar Quality (-1 == none, curr =%d): ", dude->quality[LONGRR]);
  1818. X    gets(s);
  1819. X    i=atoi(s);
  1820. X    if(val(i) && strlen(s))
  1821. X    {
  1822. X        dude->quality[LONGRR]=i;
  1823. X        dude->state[LONGRR]=100;
  1824. X    }
  1825. X    printf("Short Range Radar Quality (-1 == none, curr =%d): ", dude->quality[SHORTRR]);
  1826. X    gets(s);
  1827. X    i=atoi(s);
  1828. X    if(val(i) && strlen(s))
  1829. X    {
  1830. X        dude->quality[SHORTRR]=i;
  1831. X        dude->state[SHORTRR]=100;
  1832. X    }
  1833. X    printf("Repair Quality (-1 == none, curr =%d): ", dude->quality[REPAIR]);
  1834. X    gets(s);
  1835. X    i=atoi(s);
  1836. X    if(val(i) && strlen(s))
  1837. X    {
  1838. X        dude->quality[REPAIR]=i;
  1839. X        dude->state[REPAIR]=100;
  1840. X    }
  1841. X    printf("Targeting Quality (-1 == none, curr =%d): ", dude->quality[TC]);
  1842. X    gets(s);
  1843. X    i=atoi(s);
  1844. X    if(val(i) && strlen(s))
  1845. X    {
  1846. X        dude->quality[TC]=i;
  1847. X        dude->state[TC]=100;
  1848. X    }
  1849. X    printf("Jamming Quality (-1 == none, curr =%d): ", dude->quality[CLOAK]);
  1850. X    gets(s);
  1851. X    i=atoi(s);
  1852. X    if(val(i) && strlen(s))
  1853. X    {
  1854. X        dude->quality[CLOAK]=i;
  1855. X        dude->state[CLOAK]=100;
  1856. X    }
  1857. X    for(i=0; i<NO_WEAPONS; i++)
  1858. X    {
  1859. X        printf("Do you want a ");
  1860. X        if(dude->does_have_weap[i])
  1861. X            printf("%s (y): ", weap_names[i]);
  1862. X        else
  1863. X            printf("%s (n): ", weap_names[i]);
  1864. X        gets(s);
  1865. X        if(!strcmp(s,"y"))
  1866. X            dude->does_have_weap[i]=1;
  1867. X        else
  1868. X            dude->does_have_weap[i]=0;
  1869. X    }
  1870. X    printf("Left Shield at (%d): ", dude->ls_max);
  1871. X    gets(s);
  1872. X    i=atoi(s);
  1873. X    if(strlen(s)) dude->ls_max=i;
  1874. X    printf("Right Shield at (%d): ", dude->rs_max);
  1875. X    gets(s);
  1876. X    i=atoi(s);
  1877. X    if(strlen(s)) dude->rs_max=i;
  1878. X    printf("Bottom Shield at (%d): ", dude->bs_max);
  1879. X    gets(s);
  1880. X    i=atoi(s);
  1881. X    if(strlen(s)) dude->bs_max=i;
  1882. X    printf("Energy at (%d): ", dude->energy_max);
  1883. X    gets(s);
  1884. X    i=atoi(s);
  1885. X    if(strlen(s)) dude->energy_max=i;
  1886. X    printf("Credits (%d): ", dude->credits);
  1887. X    gets(s);
  1888. X    i=atoi(s);
  1889. X    if(strlen(s)) dude->credits=i;
  1890. X    save_dude(dude);
  1891. X}
  1892. END_OF_FILE
  1893. if test 2759 -ne `wc -c <'util.c'`; then
  1894.     echo shar: \"'util.c'\" unpacked with wrong size!
  1895. fi
  1896. # end of 'util.c'
  1897. fi
  1898. if test -f 'xoutput.c' -a "${1}" != "-c" ; then 
  1899.   echo shar: Will not clobber existing file \"'xoutput.c'\"
  1900. else
  1901. echo shar: Extracting \"'xoutput.c'\" \(5647 characters\)
  1902. sed "s/^X//" >'xoutput.c' <<'END_OF_FILE'
  1903. X/* xoutput.c - ***  */
  1904. X
  1905. Xstatic char sccs_id[] = "@(#)xoutput.c 1.8 92/12/04 XMPB";
  1906. X#include <stdlib.h>
  1907. X#include <stdio.h>
  1908. X
  1909. X#include <X11/Xlib.h>
  1910. X#include <X11/Xutil.h>
  1911. X#include <X11/cursorfont.h>
  1912. X#include "bitmaps/ship.0"
  1913. X#include "player.h"
  1914. X
  1915. X#define FULL_CIRCLE    (360*64)
  1916. X#define START_CIRCLE 0
  1917. X#define BORDER_WIDTH    2
  1918. X#define RES_NAME    "xfe"
  1919. X#define RES_CLASS    "XFE"
  1920. X
  1921. X#define CIRCLE    1
  1922. X#define POINT    2
  1923. X#define LINE    3
  1924. X#define TEXT    4
  1925. X
  1926. Xstruct player *first_win = NULL;
  1927. X
  1928. Xwinptr xfe_open_window(dn,x,y,w,h,minw,maxw,minh,maxh,title)
  1929. Xchar *dn;
  1930. Xint x,y,w,h;
  1931. Xint minw,maxw,minh,maxh;
  1932. Xchar *title;
  1933. X{
  1934. X    XGCValues        theGCValues;
  1935. X    int flag;
  1936. X    int *depths;
  1937. X    int num_depths;
  1938. X    int i;
  1939. X
  1940. X    XSetWindowAttributes    theWindowAttributes;
  1941. X    XSizeHints        theSizeHints;
  1942. X    unsigned long        theWindowMask;
  1943. X    Pixmap            theIconPixmap;
  1944. X    XWMHints        theWMHints;
  1945. X    XClassHint        theClassHint;
  1946. X    XVisualInfo        *VI,visualinfo;
  1947. X
  1948. X    winptr xfewinptr;
  1949. X
  1950. X    xfewinptr = (winptr)malloc(sizeof(struct player));
  1951. X    if(xfewinptr == NULL)
  1952. X    {
  1953. X        return NULL;
  1954. X    }
  1955. X
  1956. X    xfewinptr->x = x;
  1957. X    xfewinptr->y = y;
  1958. X    xfewinptr->w = w;
  1959. X    xfewinptr->h = h;
  1960. X    xfewinptr->minw = minw;
  1961. X    xfewinptr->maxw = maxw;
  1962. X    xfewinptr->minh = minh;
  1963. X    xfewinptr->maxw = maxw;
  1964. X    xfewinptr->title = title;
  1965. X    
  1966. X    if(!strcmp(dn,"")) xfewinptr->theDisplay = XOpenDisplay(NULL);
  1967. X    else
  1968. X        xfewinptr->theDisplay = XOpenDisplay(dn);
  1969. X
  1970. X    if(!(xfewinptr->theDisplay))
  1971. X    {
  1972. X        free(xfewinptr);
  1973. X        return NULL;
  1974. X    }
  1975. X
  1976. X    
  1977. X    xfewinptr->theScreen = DefaultScreen(xfewinptr->theDisplay);
  1978. X
  1979. X    xfewinptr->thedepth = DefaultDepth(xfewinptr->theDisplay,xfewinptr->theScreen);
  1980. X    xfewinptr->theBlackPixel = BlackPixel(xfewinptr->theDisplay,xfewinptr->theScreen);
  1981. X    xfewinptr->theWhitePixel = WhitePixel(xfewinptr->theDisplay,xfewinptr->theScreen);
  1982. X    xfewinptr->theCursor = XCreateFontCursor(xfewinptr->theDisplay,XC_crosshair);
  1983. X
  1984. X    theWindowAttributes.border_pixel = xfewinptr->theBlackPixel;
  1985. X    theWindowAttributes.background_pixel = xfewinptr->theBlackPixel;
  1986. X    theWindowAttributes.cursor = xfewinptr->theCursor;
  1987. X    theWindowAttributes.override_redirect = False;
  1988. X
  1989. X    theWindowMask = CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWCursor;
  1990. X
  1991. X    xfewinptr->theWindow = XCreateWindow(xfewinptr->theDisplay,
  1992. X            RootWindow(xfewinptr->theDisplay,xfewinptr->theScreen),
  1993. X            x,y,w,h,BORDER_WIDTH,CopyFromParent,CopyFromParent,
  1994. X            CopyFromParent,theWindowMask,&theWindowAttributes);
  1995. X
  1996. X    theIconPixmap = XCreateBitmapFromData(xfewinptr->theDisplay,xfewinptr->theWindow,ship0_bits,
  1997. X                        ship0_width,ship0_height);
  1998. X    theWMHints.initial_state = NormalState;
  1999. X
  2000. X    theWMHints.icon_pixmap = theIconPixmap;
  2001. X    
  2002. X    theWMHints.flags = IconPixmapHint | StateHint;
  2003. X
  2004. X    XSetWMHints(xfewinptr->theDisplay,xfewinptr->theWindow,&theWMHints);
  2005. X
  2006. X    XStoreName(xfewinptr->theDisplay,xfewinptr->theWindow,xfewinptr->title);
  2007. X    XSetIconName(xfewinptr->theDisplay,xfewinptr->theWindow,xfewinptr->title);
  2008. X
  2009. X    theClassHint.res_name = RES_NAME;
  2010. X    theClassHint.res_class = RES_CLASS;
  2011. X
  2012. X    XSetClassHint(xfewinptr->theDisplay,xfewinptr->theWindow,&theClassHint);
  2013. X
  2014. X    theSizeHints.flags = USPosition | USSize | PMinSize | PMaxSize;
  2015. X    theSizeHints.x     = x;
  2016. X    theSizeHints.y       = y;
  2017. X    theSizeHints.width = w;
  2018. X    theSizeHints.height = h;
  2019. X    theSizeHints.min_width = minw;
  2020. X    theSizeHints.max_width = maxw;
  2021. X    theSizeHints.min_height = minh;
  2022. X    theSizeHints.max_height = maxh;
  2023. X
  2024. X    XSetNormalHints(xfewinptr->theDisplay,xfewinptr->theWindow,&theSizeHints);
  2025. X    theGCValues.function = GXcopy;
  2026. X    theGCValues.foreground = xfewinptr->theWhitePixel;
  2027. X    theGCValues.background = xfewinptr->theBlackPixel;
  2028. X    theGCValues.graphics_exposures = False;
  2029. X    xfewinptr->theGC = XCreateGC(xfewinptr->theDisplay,xfewinptr->theWindow,(unsigned long)(GCFunction|GCForeground|GCBackground),&theGCValues);
  2030. X
  2031. X    if(xfewinptr->theGC == 0)
  2032. X    {
  2033. X        XDestroyWindow(xfewinptr->theDisplay,xfewinptr->theWindow);
  2034. X        free(xfewinptr);
  2035. X        return NULL;
  2036. X    }
  2037. X    XSetForeground(xfewinptr->theDisplay,xfewinptr->theGC,xfewinptr->theBlackPixel);
  2038. X    XSetBackground(xfewinptr->theDisplay,xfewinptr->theGC,xfewinptr->theWhitePixel);
  2039. X/*
  2040. X    XSelectInput(xfewinptr->theDisplay,xfewinptr->theWindow,ExposureMask);
  2041. X*/
  2042. X    XMapWindow(xfewinptr->theDisplay,xfewinptr->theWindow);
  2043. X    XFlush(xfewinptr->theDisplay);
  2044. X
  2045. X    if(xfewinptr->next = first_win)
  2046. X        xfewinptr->next->prev = xfewinptr;
  2047. X    xfewinptr->prev = NULL;
  2048. X    first_win = xfewinptr;
  2049. X
  2050. X    return xfewinptr;
  2051. X
  2052. X}
  2053. X
  2054. Xvoid xfe_clear(win)
  2055. Xwinptr win;
  2056. X{
  2057. X    XClearWindow(win->theDisplay,win->theWindow);
  2058. X    XFlush(win->theDisplay);
  2059. X}
  2060. X
  2061. Xvoid xfe_circle(win,x,y,rad)
  2062. Xwinptr win;
  2063. Xint x,y,rad;
  2064. X{
  2065. X
  2066. X    XDrawArc(win->theDisplay,win->theWindow,win->theGC,x-rad,y-rad,2*rad,2*rad,START_CIRCLE,FULL_CIRCLE);
  2067. X    XFlush(win->theDisplay);
  2068. X}
  2069. X
  2070. Xvoid xfe_point(win,x,y)
  2071. Xwinptr win;
  2072. Xint x,y;
  2073. X{
  2074. X
  2075. X    XDrawPoint(win->theDisplay,win->theWindow,win->theGC,x,y);
  2076. X    XFlush(win->theDisplay);
  2077. X}
  2078. X
  2079. Xvoid xfe_line(win,x,y,x1,y1)
  2080. Xwinptr win;
  2081. Xint x,y,x1,y1;
  2082. X{
  2083. X    XDrawLine(win->theDisplay,win->theWindow,win->theGC,x,y,x1,y1);
  2084. X    XFlush(win->theDisplay);
  2085. X}
  2086. X
  2087. Xvoid xfe_text(win,x,y,s)
  2088. Xwinptr win;
  2089. Xint x,y;
  2090. Xchar *s;
  2091. X{
  2092. X    XDrawString(win->theDisplay,win->theWindow,win->theGC,x,y,s,strlen(s));
  2093. X    XFlush(win->theDisplay);
  2094. X}
  2095. X
  2096. Xvoid xfe_fgcolor(col)
  2097. Xint col;
  2098. X{
  2099. X}
  2100. X
  2101. Xvoid xfe_bkcolor(col)
  2102. Xint col;
  2103. X{
  2104. X}
  2105. X
  2106. Xvoid xfe_rectangle(win,x,y,x1,y1)
  2107. Xwinptr win;
  2108. Xint x,y,x1,y1;
  2109. X{
  2110. X    XDrawRectangle(win->theDisplay,win->theScreen,win->theGC,x,y,x1-x,y1-y);
  2111. X    XFlush(win->theDisplay);
  2112. X}
  2113. X
  2114. Xvoid xfe_box(win,x,y,x1,y1)
  2115. Xwinptr win;
  2116. Xint x,y,x1,y1;
  2117. X{
  2118. X    XFillRectangle(win->theDisplay,win->theWindow,win->theGC,x,y,x1-x,y1-y);
  2119. X    XFlush(win->theDisplay);
  2120. X}
  2121. X
  2122. Xvoid xfe_fill(x,y)
  2123. Xint x,y;
  2124. X{
  2125. X}
  2126. X
  2127. Xvoid xfe_solidcircle(win,x,y,rad)
  2128. Xwinptr win;
  2129. Xint x,y,rad;
  2130. X{
  2131. X    XFillArc(win->theDisplay,win->theWindow,win->theGC,x-rad,y-rad,2*rad,2*rad,START_CIRCLE,FULL_CIRCLE);
  2132. X    XFlush(win->theDisplay);
  2133. X}
  2134. X
  2135. Xvoid xfe_linestyle(ls)
  2136. Xint ls;
  2137. X{
  2138. X}
  2139. X
  2140. X
  2141. END_OF_FILE
  2142. if test 5647 -ne `wc -c <'xoutput.c'`; then
  2143.     echo shar: \"'xoutput.c'\" unpacked with wrong size!
  2144. fi
  2145. # end of 'xoutput.c'
  2146. fi
  2147. echo shar: End of archive 5 \(of 8\).
  2148. cp /dev/null ark5isdone
  2149. MISSING=""
  2150. for I in 1 2 3 4 5 6 7 8 ; do
  2151.     if test ! -f ark${I}isdone ; then
  2152.     MISSING="${MISSING} ${I}"
  2153.     fi
  2154. done
  2155. if test "${MISSING}" = "" ; then
  2156.     echo You have unpacked all 8 archives.
  2157.     rm -f ark[1-9]isdone
  2158. else
  2159.     echo You still need to unpack the following archives:
  2160.     echo "        " ${MISSING}
  2161. fi
  2162. ##  End of shell archive.
  2163. exit 0
  2164.