]> git.pld-linux.org Git - packages/doomsday.git/commitdiff
- new auto/th/doomsday-1_9_0-0_beta6_9_7
authorAdam Gołębiowski <adamg@pld-linux.org>
Sun, 12 Feb 2012 18:32:23 +0000 (18:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    doomsday-libpng15.patch -> 1.1

doomsday-libpng15.patch [new file with mode: 0644]

diff --git a/doomsday-libpng15.patch b/doomsday-libpng15.patch
new file mode 100644 (file)
index 0000000..8cba0e1
--- /dev/null
@@ -0,0 +1,95 @@
+--- deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c~  2010-04-07 22:52:50.000000000 +0200
++++ deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c   2012-02-12 19:29:04.632968012 +0100
+@@ -89,8 +89,9 @@
+     png_structp png_ptr = 0;
+     png_infop   png_info = 0, end_info = 0;
+     png_bytep  *rows, pixel;
++    png_colorp  png_palette;
+     unsigned char *retbuf = 0;  // The return buffer.
+-    int         i, k, off;
++    int         i, k, off, num_palette;
+     if((file = F_Open(fileName, "rb")) == NULL)
+         return NULL;
+@@ -119,18 +120,18 @@
+                     // Check if it can be used.
+                     canLoad = true;
+-                    if(png_info->bit_depth != 8)
++                    if(png_get_bit_depth(png_ptr, png_info) != 8)
+                     {
+                         Con_Message("PNG_Load: \"%s\": Bit depth must be 8.\n", fileName);
+                         canLoad = false;
+                     }
+-                    else if(!png_info->width || !png_info->height)
++                    else if(!png_get_image_width(png_ptr, png_info) || !png_get_image_height(png_ptr, png_info))
+                     {
+                         Con_Message("PNG_Load: \"%s\": Bad file? Size is zero.\n", fileName);
+                         canLoad = false;
+                     }
+-                    else if(png_info->channels <= 2 && 
+-                            png_info->color_type == PNG_COLOR_TYPE_PALETTE &&
++                    else if(png_get_channels(png_ptr, png_info) <= 2 && 
++                            png_get_color_type(png_ptr, png_info) == PNG_COLOR_TYPE_PALETTE &&
+                             !png_get_valid(png_ptr, png_info, PNG_INFO_PLTE))
+                     {
+                         Con_Message("PNG_Load: \"%s\": Palette is invalid.\n", fileName);
+@@ -140,9 +141,9 @@
+                     if(canLoad)
+                     {
+                         // Information about the image.
+-                        *width = png_info->width;
+-                        *height = png_info->height;
+-                        *pixelSize = png_info->channels;
++                        *width = png_get_image_width(png_ptr, png_info);
++                        *height = png_get_image_height(png_ptr, png_info);
++                        *pixelSize = png_get_channels(png_ptr, png_info);
+                         // Paletted images have three color components
+                         // per pixel.
+@@ -154,33 +155,34 @@
+                         // OK, let's copy it into Doomsday's buffer.
+                         // \fixme Why not load directly into it?
+                         retbuf =
+-                            M_Malloc(4 * png_info->width * png_info->height);
++                            M_Malloc(4 * png_get_image_width(png_ptr, png_info) * png_get_image_height(png_ptr, png_info));
+                         rows = png_get_rows(png_ptr, png_info);
++                      png_get_PLTE(png_ptr, png_info, &png_palette, &num_palette);
+                         for(i = 0; i < *height; ++i)
+                         {
+-                            if(png_info->channels >= 3)
++                            if(png_get_channels(png_ptr, png_info) >= 3)
+                             {
+-                                memcpy(retbuf + i * (*pixelSize) * png_info->width,
+-                                       rows[i], (*pixelSize) * png_info->width);
++                                memcpy(retbuf + i * (*pixelSize) * png_get_image_width(png_ptr, png_info),
++                                       rows[i], (*pixelSize) * png_get_image_width(png_ptr, png_info));
+                             }
+                             else // Paletted image.
+                             {
+                                 for(k = 0; k < *width; ++k)
+                                 {
+-                                    pixel = retbuf + ((*pixelSize) * (i * png_info->width + k));
+-                                    off = k * png_info->channels;
+-                                    if(png_info->color_type == PNG_COLOR_TYPE_PALETTE)
++                                    pixel = retbuf + ((*pixelSize) * (i * png_get_image_width(png_ptr, png_info) + k));
++                                    off = k * png_get_channels(png_ptr, png_info);
++                                    if(png_get_color_type(png_ptr, png_info) == PNG_COLOR_TYPE_PALETTE)
+                                     {
+-                                        pixel[0] = png_info->palette[rows[i][off]].red;
+-                                        pixel[1] = png_info->palette[rows[i][off]].green;
+-                                        pixel[2] = png_info->palette[rows[i][off]].blue;
++                                        pixel[0] = png_palette[rows[i][off]].red;
++                                        pixel[1] = png_palette[rows[i][off]].green;
++                                        pixel[2] = png_palette[rows[i][off]].blue;
+                                     }
+                                     else
+                                     {
+                                         // Grayscale.
+                                         pixel[0] = pixel[1] = pixel[2] = rows[i][off];
+                                     }
+-                                    if(png_info->channels == 2) // Alpha data.
++                                    if(png_get_channels(png_ptr, png_info) == 2) // Alpha data.
+                                     {
+                                         pixel[3] = rows[i][off + 1];
+                                     }
This page took 0.058146 seconds and 4 git commands to generate.