[aseprite] 92/250: Fix problem getting pixels in non-32bpp Allegro BITMAPs

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 4ebefd3f13d79f5a953a1e9acd75bb6001d461d0
Author: David Capello <davidcapello at gmail.com>
Date:   Fri Sep 25 08:32:50 2015 -0300

    Fix problem getting pixels in non-32bpp Allegro BITMAPs
    
    Regression introduced in 5e3ba8237a7216b0eba3f3be269d201786ed09c9
    This changed was needed to load certain .png fonts correctly in the
    SkinTheme.
---
 src/allegro/src/color.c          | 2 ++
 src/she/alleg4/alleg_surface.cpp | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/allegro/src/color.c b/src/allegro/src/color.c
index b2ef52d..2a98ff1 100644
--- a/src/allegro/src/color.c
+++ b/src/allegro/src/color.c
@@ -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;
 }
 
diff --git a/src/she/alleg4/alleg_surface.cpp b/src/she/alleg4/alleg_surface.cpp
index 3873e4a..0daa734 100644
--- a/src/she/alleg4/alleg_surface.cpp
+++ b/src/she/alleg4/alleg_surface.cpp
@@ -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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list