]> git.pld-linux.org Git - packages/ClanLib.git/blob - ClanLib-Magick.patch
- BuildRequires for Mesa-devel changed to OpenGL-devel.
[packages/ClanLib.git] / ClanLib-Magick.patch
1
2 This patch makes ClanLib-0.4.3 compile with ImageMagick-5.1.1
3 I know it probably could be done i one ImageMagick call, but I don't know what
4 the code was ment to do.
5
6 diff -durN ClanLib-0.4.3.orig/Sources/Magick/provider_magick.cpp ClanLib-0.4.3/Sources/Magick/provider_magick.cpp
7 --- ClanLib-0.4.3.orig/Sources/Magick/provider_magick.cpp       Mon Mar 13 18:12:50 2000
8 +++ ClanLib-0.4.3/Sources/Magick/provider_magick.cpp    Wed Apr 19 10:04:12 2000
9 @@ -138,12 +138,9 @@
10         height = image->rows;
11         pitch = width * get_bytes_per_pixel();
12         
13 -       float *rdata = new float[width*height];
14 -       float *gdata = new float[width*height];
15 -       float *bdata = new float[width*height];
16 -       float *adata = new float[width*height];
17 +       float *rgbadata = new float[width*height*4];
18         
19 -       GetPixels(image, rdata, gdata, bdata, adata);
20 +       GetPixels(image, 0,0,width,height,"RGBA",FloatPixel,rgbadata);
21         DestroyImage(image);
22         
23         // here comes the tricky part ... hmhmhm... Quicky Mart
24 @@ -186,10 +183,10 @@
25         for (int y=0; y<height; y++)
26                 for (int x=0; x<width; x++)
27                 {
28 -                       tmp = (((unsigned int) (rdata[y*width+x] * rtmp)) << rshift) |
29 -                             (((unsigned int) (gdata[y*width+x] * gtmp)) << gshift) |
30 -                             (((unsigned int) (bdata[y*width+x] * btmp)) << bshift) |
31 -                             (((unsigned int) (atmp - adata[y*width+x] * atmp)) << ashift);
32 +                       tmp = (((unsigned int) (rgbadata[(y*width+x)*4] * rtmp)) << rshift) |
33 +                             (((unsigned int) (rgbadata[(y*width+x)*4+1] * gtmp)) << gshift) |
34 +                             (((unsigned int) (rgbadata[(y*width+x)*4+2] * btmp)) << bshift) |
35 +                             (((unsigned int) (atmp - rgbadata[(y*width+x)*4+3] * atmp)) << ashift);
36  
37                         switch (get_bytes_per_pixel())
38                         {
39 @@ -212,10 +209,7 @@
40                         }
41                 }
42  
43 -       delete[] rdata;
44 -       delete[] gdata;
45 -       delete[] bdata;
46 -       delete[] adata;
47 +       delete[] rgbadata;
48  }              
49  
50  void CL_MagickProvider::perform_unlock()
This page took 0.122372 seconds and 3 git commands to generate.