Re: [AD] Bug with transparent ellipses

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



Elias Pschernig wrote:
> On Sun, 2006-09-03 at 19:08 -0400, Jon Rafkind wrote:   
>   
>> Ok, but with your patch doesnt it automatically use al_assert whereas
>> al_assert is only turned on when DEBUGMODE is enabled?
>>
>> #ifdef DEBUGMODE
>>    #define ASSERT(condition)     { if (!(condition)) al_assert(__FILE__,
>> __LINE__); }
>>    #define TRACE                 al_trace
>> #else
>>    #define ASSERT(condition)
>>    #define TRACE                 1 ? (void) 0 : al_trace
>> #endif
>>
>> so the code would somehow have to use ASSERT(color_map), right?
>>
>>     
>
> I added an #ifdef DEBUGMODE with the patch, so without DEBUGMODE, the
> old macro should get used.
>
>   
You are right, I missed that the first time around. As we talked about
in #allegro I think its safer to have defaults for color_map and the
blenders. Also maybe a default rgb_map. I think Allegro should try as
hard as possible not to crash. This could be accomplished by something like

static COLOR_MAP _default_color_map = ..whatever..;
color_map = _default_color_map;

static int default_blender15( .. ){ .. }

_blender_func15 = default_blender15;

The only downside would be if users tested the color_map or one of the
blenders for null before they are initialized. I see no reason for
anyone to do this or that their assumption that color_map is NULL to be
valid, so I think its ok for defaults to be used.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/