Re: [AD] Bug with transparent ellipses

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


That works, but needs to be done for the 15/16/24/32 blenders as well. I
started to do it but quickly realized there are a bunch of macros to
take care of. I think 8 bit needs this too.

#define MAKE_DTS_BLENDER()     color_map
#define MAKE_PS_BLENDER()      color_map
#define MAKE_DLS_BLENDER(a)    (color_map->data[(a) & 0xFF])

And of course the macro you fixed MAKE_PP_BLENDER. At this point would
it just be easier to set a default color_map/blender? I realize this is
a fundamental change but I dont see what harm could come from it.

Elias Pschernig wrote:
>> 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.
>
>   
> ------------------------------------------------------------------------
>
> Index: src/c/cdefs8.h
> ===================================================================
> --- 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*
> +#ifdef DEBUGMODE
> +#define MAKE_PP_BLENDER(c)     (!color_map && (al_assert(__FILE__, __LINE__), 0), (color_map->data[(c) & 0xFF]))
> +#else
>  #define MAKE_PP_BLENDER(c)     (color_map->data[(c) & 0xFF])
> +#endif
>  #define PP_BLEND(b,o,n)        ((b)[(o) & 0xFF])
>  
>  /* Blender for draw_trans_*_sprite.  */
>   
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




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