[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: the scrambled images at 24 and 32 bpp fixed?



Everything works fine for me now! :-) There is, however, a new problem.
Now when I move windows, sometimes they leave artifacts both on the
desktop and in the titlebar of the window being moved. That's better
than crashing on startup, though! :-) Good work, and thank you very
much.

Eric

Peter Bystrom wrote:
> 
> I swapped the translate function in patch-18-3 to the below, it seems
> to have fixed the problems... could someone with the problems ack? I'll
> make a patch-18-4 available within a few mins...
> 
> Sveinn and Eric seems to be good targets for this test... ;)
> 
> //
> 
> peter
> 
> ================
> 
> 
> static uint8 *
> translate (int width, int height, uint8 * data)
> {
>   uint32 i;
>   uint8 *d2 = xmalloc(width*height*TOBYTES(bpp == 24 ? 32 : bpp));
>   uint8 *d3 = d2;
> 
>   if(ImageByteOrder(display) == MSBFirst) {
>     for(i=width*height; i; i--){
>         uint32 pix = Ctrans(*data++);
>         switch( bpp ){
>                 case 32:
>                 case 24:
>                  *((uint32*)d3) =  pix;
>                  d3 += sizeof (uint32);
>                  break;
> //                 *d3++ = pix>>24;
> //                 *d3++ = pix>>16;
>                 case 16:
>                  *d3++ = pix>>8;
>                 case 8:
>                  *d3++ = pix;
>         }
>     }
>   }else{
>     for(i=width*height; i; i--){
>       uint32 pix = Ctrans(*data++);
>       switch( bpp ){
>         case 32:
>         case 24:
>                *((uint32*)d3) =  pix;
>                d3 += sizeof (uint32);
>                break;
> //              *d3++ = pix;
> //              *d3++ = pix>>8;
> //              *d3++ = pix>>16;
> //              *d3++ = pix>>24;
> //              break;
>         case 16:
>               *d3++ = pix;
>               *d3++ = pix>>8;
>                 break;
>         case 8:
>               *d3++ = pix;
>       }
>     }
>   }
> 
>   return d2;
> }