|Re: [AD] Bug with transparent ellipses|
[ Thread Index |
| More lists.liballeg.org/allegro-developers Archives
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] Bug with transparent ellipses
- From: Elias Pschernig <elias@xxxxxxxxxx>
- Date: Mon, 04 Sep 2006 00:30:03 +0200
> So I'd say, you simply forgot to set up those tables/functions. We
> probably should ASSERT for that in debug mode though - I'll try to come
> up with a patch to add such an ASSERT.
Here it is. Syntax is somewhat ugly, but I think it should always work,
and that way there's no need to add an ASSERT at all the places this
macro is used.
All it does is, it makes the program cleanly shut down with al_assert,
instead of crashing on the NULL pointer access.
--- src/c/cdefs8.h (revision 7510)
+++ src/c/cdefs8.h (working copy)
@@ -37,7 +37,11 @@
/* Blender for putpixel (DRAW_MODE_TRANS). */
#define PP_BLENDER unsigned char*
+#define MAKE_PP_BLENDER(c) (!color_map && (al_assert(__FILE__, __LINE__), 0), (color_map->data[(c) & 0xFF]))
#define MAKE_PP_BLENDER(c) (color_map->data[(c) & 0xFF])
#define PP_BLEND(b,o,n) ((b)[(o) & 0xFF])
/* Blender for draw_trans_*_sprite. */