Fix problem getting pixels in non-32bpp Allegro BITMAPs

Regression introduced in 5e3ba8237a
This changed was needed to load certain .png fonts correctly in the
SkinTheme.
This commit is contained in:
David Capello 2015-09-25 08:32:50 -03:00
parent d5fea43972
commit 4ebefd3f13
2 changed files with 4 additions and 1 deletions

View File

@ -211,6 +211,8 @@ int geta_depth(int color_depth, int c)
if (color_depth == 32)
return geta32(c);
/* dacap: This should return 255, anyway as the Debian port uses
the official Allegro library, we cannot depend on this function. */
return 0;
}

View File

@ -73,7 +73,8 @@ inline gfx::Color from_allegro(int color_depth, int color)
getr_depth(color_depth, color),
getg_depth(color_depth, color),
getb_depth(color_depth, color),
geta_depth(color_depth, color));
// This condition is here because geta_depth() returns 0 if color depth != 32
(color_depth == 32 ? geta32(color): 255));
}
Alleg4Surface::Alleg4Surface(BITMAP* bmp, DestroyFlag destroy)