masked blit bug (AMD 64/C version only?), was Re: [AD] True Colour font loading fix

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


> that I seem to be having some problems doing colour conversions from and 
to
> 24 bit. This could be an AMD64 specific problem. I haven't been able to
> reproduce it reliably with other blitting tests so I can't say what the
> problem is without doing some more research.

A bit more on this issue, the following programme (which requires mysha.pcx 
from the examples directory) illustrates the problem:

#include <allegro.h>

int main()
{
   BITMAP *bmp;
   PALETTE p;
   
   allegro_init();
   set_color_depth(32);
   set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
   install_keyboard();

   set_color_conversion(COLORCONV_NONE);
   bmp = load_bitmap("mysha.pcx", p);
   set_palette(p);
   set_color_conversion(COLORCONV_TOTAL);
   masked_blit(bmp, screen, 0,0, 0,0, bmp->w, bmp->h);
   blit(bmp, screen, 0,0, 0,bmp->h, bmp->w, bmp->h);

   readkey();

   return 0;
}
END_OF_MAIN()

The masked_blit() produces an image of a squashed Mysha displayed four 
times with screwed up colours. The normal blit works ok.
Changing the colourdepth to 16 instead of 32 bit also shows the problem, 
now with Mysha displayed twice (as to be expected) in funky colours.
Allowing colour conversions when the bitmap is loaded also fixes the 
problem.

The bug is somewhere in the C version of the masked_blit colour converter, 
but I didn't see it at first glance. I don't have more time to look at 
this right now, but I can continue to investigate tomorrow.

By the way, is there a standard colour conversion test/example programme to 
check this with?

Evert




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