From 9af6003b432f0513aa91419c6a64bf7aa2bb6d39 Mon Sep 17 00:00:00 2001 From: tegzed Date: Wed, 5 Jan 2011 14:18:18 +0000 Subject: [PATCH] Add:graphics/opengl:Added support for 64 bit per pixel image handling git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3865 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/graphics/opengl/graphics_opengl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/navit/navit/graphics/opengl/graphics_opengl.c b/navit/navit/graphics/opengl/graphics_opengl.c index 0e5c004..8bd0669 100644 --- a/navit/navit/graphics/opengl/graphics_opengl.c +++ b/navit/navit/graphics/opengl/graphics_opengl.c @@ -339,6 +339,14 @@ image_new (struct graphics_priv *gr, struct graphics_image_methods *meth, g_hash_table_insert(hImageData,g_strdup(path),&image_error); return NULL; } + + if (FreeImage_GetBPP (image) == 64) { + FIBITMAP *image2; + image2 = FreeImage_ConvertTo32Bits(image); + FreeImage_Unload(image); + image = image2; + } + gi = g_new0 (struct graphics_image_priv, 1); width = FreeImage_GetWidth (image); @@ -380,12 +388,6 @@ image_new (struct graphics_priv *gr, struct graphics_image_methods *meth, data[4 * width * i + 4 * j + 3] = transparent ? 0 : 255; } - else if (FreeImage_GetBPP (image) == 64) - { - //FreeImage_GetPixelColor does not handle 64bits/pixel images correctly - g_hash_table_insert(hImageData,g_strdup(path),&image_error); - return NULL; - } } } -- 2.7.4