Example #1
0
void DrawField( GtkWidget* widget, GdkGC* gc )
{
  GdkDrawable *drawable = GDK_DRAWABLE( widget->window );
  GdkPoint     sz = { widget->allocation.width, widget->allocation.height };
  GdkPoint     center = {XToScreen(0, sz), YToScreen(0, sz)};

  // Fill the Universe with black
  gdk_gc_set_rgb_fg_color( gc, &BLACK );
  gdk_draw_rectangle( drawable, gc, TRUE, 0, 0, sz.x, sz.y );

  // Draw the star
  DrawCircle( drawable, gc, true, center, int(StarRadius*Scale), STAR_COLOR );

  // Draw the dangerous area
  DrawCircle( drawable, gc, false, center, int(AlarmRadius()*Scale), ORANGE );

  // Draw the best area
  DrawCircle( drawable, gc, false, center, int(SafeRadius()*Scale), GREEN );

  // Draw the dead area
  DrawCircle( drawable, gc, false, center, int(DeathRadius()*Scale), DARK_RED );

  // Draw the vehicles
  DrawShips( drawable, gc, sz );
}
Example #2
0
inline void local(void)
/*
 * Draw out the 'tactical' map
 */
{
  if (me->p_x < 0)
    return;

  DrawPlanets();
  DrawShips();
  DrawTorps();
  DrawPlasmaTorps();

  weaponUpdate = 0;
  DrawMisc();
}