static struct item *
garmin_poi2item(struct map_rect_priv *mr, struct gobject *o, unsigned short otype)
{
- if (mr->mpriv->conv)
- mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POINT, otype);
+ if (mr->mpriv->conv) {
+ int mask = gar_object_group(o) << G2N_KIND_SHIFT;
+ mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POINT|mask, otype);
+ }
mr->item.meth = &methods_garmin_point;
return &mr->item;
}
static struct item *
garmin_pl2item(struct map_rect_priv *mr, struct gobject *o, unsigned short otype)
{
- if (mr->mpriv->conv)
- mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POLYLINE, otype);
+ if (mr->mpriv->conv) {
+ int mask = gar_object_group(o) << G2N_KIND_SHIFT;
+ mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POLYLINE|mask, otype);
+ }
mr->item.meth = &methods_garmin_poly;
return &mr->item;
}
static struct item *
garmin_pg2item(struct map_rect_priv *mr, struct gobject *o, unsigned short otype)
{
- if (mr->mpriv->conv)
- mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POLYGONE, otype);
+ if (mr->mpriv->conv) {
+ int mask = gar_object_group(o) << G2N_KIND_SHIFT;
+ mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POLYGONE|mask, otype);
+ }
mr->item.meth = &methods_garmin_poly;
return &mr->item;
}
struct map_priv *m;
struct attr *data;
struct attr *debug;
+ struct attr *flags;
char buf[PATH_MAX];
struct stat st;
int dl = 1;
struct gar_config cfg;
+ int debugmask = 0;
data=attr_search(attrs, NULL, attr_data);
if (! data)
if (!dl)
dl = 1;
}
+ flags=attr_search(attrs, NULL, attr_flags);
+ if (flags) {
+ debugmask = flags->u.num;
+ }
m=g_new(struct map_priv, 1);
m->id=++map_id;
m->filename = strdup(data->u.str);
memset(&cfg, 0, sizeof(struct gar_config));
cfg.opm = OPM_GPS;
cfg.debuglevel = dl;
+ cfg.debugmask = debugmask;
garmin_debug = dl;
m->g = gar_init_cfg(NULL, logfn, &cfg);
if (!m->g) {