From 6425107c400effed338ad04e96c767d7b959054f Mon Sep 17 00:00:00 2001 From: tegzed Date: Mon, 21 Mar 2011 17:40:31 +0000 Subject: [PATCH] Fix:graphics/opengl:Added support for image scaling git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4380 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/graphics/opengl/graphics_opengl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/navit/navit/graphics/opengl/graphics_opengl.c b/navit/navit/graphics/opengl/graphics_opengl.c index 230713a..87bf0d4 100644 --- a/navit/navit/graphics/opengl/graphics_opengl.c +++ b/navit/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; -- 2.7.4