|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 1763 (0x6e3) Types: TextFile Names: »planetlist.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/X/Xtrek/planetlist.c«
static char sccsid[] = "@(#)planetlist.c 1.1"; /* Copyright (c) 1986 Chris Guthrie Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ #include <X11/Xlib.h> #include <stdio.h> #include "defs.h" #include "data.h" static char *teamname[9] = { "IND", "FED", "ROM", "", "KLI", "", "", "", "ORI" }; /* ** Open a window which contains all the planets and their current ** statistics. Players will not know about planets that their team ** has not orbited. */ planetlist(p) register struct player *p; { register int i; register int k = 0; char buf[BUFSIZ]; register struct planet *j; (void) sprintf(buf, " # Planet Name own armies REPAIR FUEL"); XDrawImageString(p->display, p->planetw, p->dfgc, 0, p->dfont->ascent, buf, strlen(buf)); k = 2; for (i = 0, j = &planets[0]; i < MAXPLANETS; i++, j++) { if (j->pl_info & p->p_team) { (void) sprintf(buf, " %2d %-16s %3s %3d %6s %4s", j->pl_no, j->pl_name, teamname[j->pl_owner], j->pl_armies, (j->pl_flags & PLREPAIR ? "REPAIR" : " "), (j->pl_flags & PLFUEL ? "FUEL" : " ")); } else { (void) sprintf(buf, " %2d %-16s", j->pl_no, j->pl_name); } XDrawImageString(p->display, p->planetw, p->dfgc, 0, p->dfont->ascent + fontHeight(p->dfont) * k++, buf, strlen(buf)); } XFlush(p->display); }