diff options
author | tegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-03-21 17:40:31 +0000 |
---|---|---|
committer | tegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-03-21 17:40:31 +0000 |
commit | 6b948313e2e93b755bc432a8069b7594845353a4 (patch) | |
tree | 52c9601fef7dd0634c12502558ad04fb36ac7dc1 /navit/graphics/opengl | |
parent | 2846328e60e72d608660ab7148bc3b438e96b3cb (diff) | |
download | navit-svn-6b948313e2e93b755bc432a8069b7594845353a4.tar.gz |
Fix:graphics/opengl:Added support for image scaling
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4380 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/graphics/opengl')
-rw-r--r-- | navit/graphics/opengl/graphics_opengl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/navit/graphics/opengl/graphics_opengl.c b/navit/graphics/opengl/graphics_opengl.c index 230713a1..87bf0d41 100644 --- a/navit/graphics/opengl/graphics_opengl.c +++ b/navit/graphics/opengl/graphics_opengl.c @@ -358,6 +358,15 @@ image_new (struct graphics_priv *gr, struct graphics_image_methods *meth, width = FreeImage_GetWidth (image); height = FreeImage_GetHeight (image); + if(*w!=width || *h!=height) { + FIBITMAP *image2; + image2 = FreeImage_Rescale(image, *w, *h, NULL); + FreeImage_Unload(image); + image = image2; + width = *w; + height = *h; + } + data = (unsigned char *) malloc (width * height * 4); RGBQUAD *palette = NULL; |