summaryrefslogtreecommitdiff
path: root/navit/vehicle.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 16:16:16 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 16:16:16 +0000
commitd563ed249f2451d295f13cd2bfd12c8c776099be (patch)
tree99df561b1c2d5284ceccfc3d3a412c17a274a6e4 /navit/vehicle.c
parentd2178939764027bb28292c454f50af23323ff7ec (diff)
downloadnavit-d563ed249f2451d295f13cd2bfd12c8c776099be.tar.gz
Fix:Core:MSVC fixes|Thanks chollya
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3984 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/vehicle.c')
-rw-r--r--navit/vehicle.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/navit/vehicle.c b/navit/vehicle.c
index a0d694185..52d52eb97 100644
--- a/navit/vehicle.c
+++ b/navit/vehicle.c
@@ -286,6 +286,7 @@ vehicle_remove_attr(struct vehicle *this_, struct attr *attr)
void
vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor)
{
+ struct point sc;
if (this_->animate_callback) {
event_remove_timeout(this_->animate_timer);
this_->animate_timer=NULL; // dangling pointer! prevent double freeing.
@@ -303,7 +304,6 @@ vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor)
graphics_overlay_resize(this_->gra, &this_->cursor_pnt, cursor->w, cursor->h, 65535, 0);
}
- struct point sc;
if (cursor) {
sc.x=cursor->w/2;
sc.y=cursor->h/2;
@@ -369,22 +369,24 @@ vehicle_get_cursor_data(struct vehicle *this, struct point *pnt, int *angle, int
static void
vehicle_draw_do(struct vehicle *this_, int lazy)
{
- if (!this_->cursor || !this_->cursor->attrs || !this_->gra)
- return;
-
struct point p;
struct cursor *cursor=this_->cursor;
int speed=this_->speed;
int angle=this_->angle;
int sequence=this_->sequence;
+ struct attr **attr;
+ int match=0;
+
+ if (!this_->cursor || !this_->cursor->attrs || !this_->gra)
+ return;
+
transform_set_yaw(this_->trans, -this_->angle);
graphics_draw_mode(this_->gra, draw_mode_begin);
p.x=0;
p.y=0;
graphics_draw_rectangle(this_->gra, this_->bg, &p, cursor->w, cursor->h);
- struct attr **attr=cursor->attrs;
- int match=0;
+ attr=cursor->attrs;
while (*attr) {
if ((*attr)->type == attr_itemgra) {
struct itemgra *itm=(*attr)->u.itemgra;
@@ -607,7 +609,7 @@ vehicle_log_binfile(struct vehicle *this_, struct log *log)
buffer_new[2]+=2;
if (buffer_new[2] > limit) {
int count=buffer_new[2]/2;
- struct coord out[count];
+ struct coord *out=g_alloca(sizeof(struct coord)*(count));
struct coord *in=(struct coord *)(buffer_new+3);
int count_out=transform_douglas_peucker(in, count, radius, out);
memcpy(in, out, count_out*2*sizeof(int));