static char *sccs_id= (sccs_id, "@(#)DynIconShape.c	1.2 7/28/92");

/*
 * This file implements an dynamic IconShape which is identical to
 * IconShape
 */

#include "IconShape.h"
#include "QuelInfo.h"

static short CrossImage[]= {
#   include "images/cross.image"
};

extern "C" IconShape *make_icon_shape();

IconShape *make_icon_shape(MapView *dv, int n, char **str)
{
  static BitmapInfo	*bmi;
  static Bitmap		*bm;

  if (!bmi) {
    bmi= new BitmapInfo(0, 32, 32, 64, 64, (char*) CrossImage, FALSE);
    bm= bmi->GetBitmap();
  }

  IconShape	*s= new IconShape(dv, bm);
  float		lng, lat;
  if (sscanf(str[0], "(%f,%f)", &lng, &lat) != 2) {
    fprintf(stderr, "Cannot read lng,lat\n");
    return 0;
  }
  s->Init(lng,lat);
  return s;
}
