Ejemplo n.º 1
0
static void DrawPlanets(void)
/*
 * Draw the planets on the local map.
 */
{
  register int dx, dy;
  register struct planet *l;
  const int view = SCALE * TWINSIDE / 2;

  for (l = planets + MAXPLANETS - 1; l >= planets; --l)
    {
      dx = l->pl_x - me->p_x;
      dy = l->pl_y - me->p_y;
      if (dx > view || dx < -view || dy > view || dy < -view)
  continue;

      dx = dx / SCALE + TWINSIDE / 2;
      dy = dy / SCALE + TWINSIDE / 2;


      W_WriteBitmap(dx - (planet_width / 2), dy - (planet_height / 2),
        planetBitmap(l), planetColor(l));

      if (showIND && ((l->pl_info & me->p_team)

#ifdef RECORDGAME
          || playback
#endif

    ) && (l->pl_owner == NOBODY))
  {
    W_CacheLine(w, dx - (planet_width / 2), dy - (planet_height / 2),
      dx + (planet_width / 2 - 1), dy + (planet_height / 2 - 1),
          W_White);
    W_CacheLine(w, dx + (planet_width / 2 - 1), dy - (planet_height / 2),
          dx - (planet_width / 2), dy + (planet_height / 2 - 1),
          W_White);
  }

      if (namemode)
  {
    W_MaskText(w, dx - (planet_width / 2), dy + (planet_height / 2),
         planetColor(l), l->pl_name, l->pl_namelen,
         planetFont(l));
    clearzone[0][clearcount] = dx - (planet_width / 2);
    clearzone[1][clearcount] = dy + (planet_height / 2);
    clearzone[2][clearcount] = W_Textwidth * l->pl_namelen;
    clearzone[3][clearcount] = W_Textheight;
    clearcount++;
  }

      clearzone[0][clearcount] = dx - (planet_width / 2);
      clearzone[1][clearcount] = dy - (planet_height / 2);
      clearzone[2][clearcount] = planet_width;
      clearzone[3][clearcount] = planet_height;
      clearcount++;
    }
}
Ejemplo n.º 2
0
void    planetlist(void)
{
  register int i;
  register int k = 0;
  char    buf[BUFSIZ];
  register struct planet *j;

  /* W_ClearWindow(planetw); */
  (void) sprintf(buf, "Planet Name      own armies REPAIR FUEL AGRI CORE info");
  W_WriteText(planetw, 2, 1, textColor, buf, strlen(buf), W_RegularFont);
  k = 2;
  for (i = 0, j = &planets[i]; i < MAXPLANETS; i++, j++)
    {
      if (j->pl_info & me->p_team)
	{
	  (void) sprintf(buf, "%-16s %3s %3d    %6s %4s %4s %4s %c%c%c%c",
			 j->pl_name,
			 teamname[j->pl_owner],
			 j->pl_armies,
			 (j->pl_flags & PLREPAIR ? "REPAIR" : "      "),
			 (j->pl_flags & PLFUEL ? "FUEL" : "    "),
			 (j->pl_flags & PLAGRI ? "AGRI" : "    "),
			 (j->pl_flags & PLCORE ? "CORE" : "    "),
			 (j->pl_info & FED ? 'F' : ' '),
			 (j->pl_info & ROM ? 'R' : ' '),
			 (j->pl_info & KLI ? 'K' : ' '),
			 (j->pl_info & ORI ? 'O' : ' '));
	  W_WriteText(planetw, 2, k++, planetColor(j), buf, strlen(buf),
		      planetFont(j));
	}
      else
	{
	  (void) sprintf(buf, "%-16s",
			 j->pl_name);
	  W_WriteText(planetw, 2, k++, unColor, buf, strlen(buf),
		      W_RegularFont);
	}
    }
}