int pitch;
int follow_cursor;
int prevTs;
+ int graphics_flags;
};
struct gui *main_loop_gui;
navit_vehicle_draw(this_, nv, NULL);
l=g_list_next(l);
}
- graphics_draw(this_->gra, this_->displaylist, this_->mapsets->data, this_->trans, this_->layout_current, async, NULL);
+ graphics_draw(this_->gra, this_->displaylist, this_->mapsets->data, this_->trans, this_->layout_current, async, NULL, this_->graphics_flags|1);
}
void
navit_draw_displaylist(struct navit *this_)
{
if (this_->ready == 3)
- graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layout_current, 1);
+ graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layout_current, this_->graphics_flags|1);
}
static void
int yaw;
double angleo,anglen;
- transform_reverse(tr, old, &co);
+ if (!transform_reverse(tr, old, &co))
+ return;
if (rot) {
angleo=atan2(old->y-rot->y, old->x-rot->x)*180/M_PI;
anglen=atan2(new->y-rot->y, new->x-rot->x)*180/M_PI;
yaw=transform_get_yaw(tr)+angleo-anglen;
transform_set_yaw(tr, yaw % 360);
}
- transform_reverse(tr, new, &cn);
+ if (!transform_reverse(tr, new, &cn))
+ return;
cp=transform_get_center(tr);
c.x=cp->x+co.x-cn.x;
c.y=cp->y+co.y-cn.y;
graphics_displaylist_move(this_->displaylist, dx, dy);
#endif
graphics_draw_cancel(this_->gra, this_->displaylist);
- graphics_displaylist_draw(this_->gra, this_->displaylist, tr, this_->layout_current, 0);
+ graphics_displaylist_draw(this_->gra, this_->displaylist, tr, this_->layout_current, this_->graphics_flags);
transform_destroy(tr);
this_->moved=1;
}
navit_window_roadbook_new(this_);
navit_window_items_new(this_);
#endif
- callback_list_call_attr_1(this_->attr_cbl, attr_navit, this_);
- this_->ready|=1;
messagelist_init(this_->messages);
navit_set_cursors(this_);
+ callback_list_call_attr_1(this_->attr_cbl, attr_navit, this_);
+ this_->ready|=1;
dbg(2,"ready=%d\n",this_->ready);
if (this_->ready == 3)
navit_draw(this_);
attr_updated=(this_->drag_bitmap != !!attr->u.num);
this_->drag_bitmap=!!attr->u.num;
break;
+ case attr_flags_graphics:
+ attr_updated=(this_->graphics_flags != attr->u.num);
+ this_->graphics_flags=attr->u.num;
+ break;
case attr_follow:
if (!this_->vehicle)
return 0;
this_->layout_current=attr->u.layout;
graphics_font_destroy_all(this_->gra);
navit_set_cursors(this_);
- navit_draw(this_);
+ if (this_->ready == 3)
+ navit_draw(this_);
attr_updated=1;
}
break;
}
transform_set_yaw(this_->trans, dir);
if (orient_old != this_->orientation) {
+#if 0
if (this_->ready == 3)
navit_draw(this_);
+#endif
attr_updated=1;
}
}
case attr_osd_configuration:
attr->u.num=this_->osd_configuration;
break;
+ case attr_pitch:
+ attr->u.num=transform_get_pitch(this_->trans);
+ break;
case attr_projection:
if(this_->trans) {
attr->u.num=transform_get_projection(this_->trans);