diff options
author | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-07-13 20:37:21 +0000 |
---|---|---|
committer | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-07-13 20:37:21 +0000 |
commit | 9bf6351195580a917a8beaea8ae09b475733305b (patch) | |
tree | 348982a8ff4008983916195f9330f2eeb6cf6a4b /navit/transform.c | |
parent | 7c7753887db05491b0a5490c596eda4dfec88d36 (diff) | |
download | navit-9bf6351195580a917a8beaea8ae09b475733305b.tar.gz |
Fix:core:Integrate transform_setup into transform_new. Avoids two-step initialization and access to undefined variables in struct transform.|Part of fix for #1145.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5544 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/transform.c')
-rw-r--r-- | navit/transform.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/navit/transform.c b/navit/transform.c index 425fdd05b..b7949f095 100644 --- a/navit/transform.c +++ b/navit/transform.c @@ -169,21 +169,18 @@ transform_setup_matrix(struct transformation *t) } struct transformation * -transform_new(void) +transform_new(struct pcoord *center, int scale, int yaw) { struct transformation *this_; this_=g_new0(struct transformation, 1); transform_set_screen_dist(this_, 100); this_->order_base=14; -#if 0 - this_->pitch=20; -#endif -#if 0 - this_->roll=30; - this_->hog=1000; -#endif - transform_setup_matrix(this_); + this_->pro=center->pro; + this_->map_center.x=center->x; + this_->map_center.y=center->y; + this_->scale=scale/16.0; + transform_set_yaw(this_, yaw); return this_; } @@ -852,16 +849,6 @@ transform_get_size(struct transformation *t, int *width, int *height) } void -transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw) -{ - t->pro=c->pro; - t->map_center.x=c->x; - t->map_center.y=c->y; - t->scale=scale/16.0; - transform_set_yaw(t, yaw); -} - -void transform_setup_source_rect(struct transformation *t) { int i; |