rpms/raidem/devel raidem-0.3-loadpng.patch, NONE, 1.1 raidem.spec, 1.3, 1.4

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Mon Jun 19 17:39:04 UTC 2006


Author: jwrdegoede

Update of /cvs/extras/rpms/raidem/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14730

Modified Files:
	raidem.spec 
Added Files:
	raidem-0.3-loadpng.patch 
Log Message:
* Sun Apr  2 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 0.3-2
- Add missing RPM_OPT_FLAGS to CFLAGS
- Add missing -D__LINUX__ to CFLAGS with this patch2 is no longer needed
- Add -fsigned-char to CFLAGS this fixes crashing on startup on PPC (bz 185850)
- Add Patch3 which fixes funky colors on PPC (bz 185850)


raidem-0.3-loadpng.patch:

--- NEW FILE raidem-0.3-loadpng.patch ---
--- raidem-0.3-src/lib/loadpng/loadpng.c.aap	2006-01-23 00:09:29.000000000 +0100
+++ raidem-0.3-src/lib/loadpng/loadpng.c	2006-04-06 20:45:08.000000000 +0200
@@ -193,12 +193,33 @@
     dest_bpp = _color_load_depth(bpp, (bpp == 32));
     bmp = create_bitmap_ex(bpp, width, height);
 
-    /* Maybe flip RGB to BGR. */
+    /* Check for any nescesarry conversions */
     if ((bpp == 24) || (bpp == 32)) {
-	int c = makecol_depth(bpp, 0, 0, 255);
+	int c = makeacol_depth(bpp, 1, 2, 3, 7); /* R, G, B, A */
 	unsigned char *pc = (unsigned char *)&c;
-	if (pc[0] == 255)
-	    png_set_bgr(png_ptr);
+	/* First find the alpha location, alpha will be 0 when not used/NA! */
+	if ((pc[0] == 7) || (pc[0] == 0))
+	{
+	    /* alpha as byte 0 check if byte 1 is blue ifso flip RGB to BGR */
+	    if (pc[1] == 3)
+	        png_set_bgr(png_ptr);
+            /* do we have an alpha channel? */
+            if (bpp == 32)
+            {
+                if (pc[0] != 7)
+                    fprintf(stderr, "loadpng: warning, png has alpha channel but allegro not in color_depth with an alpha channel!\n");
+                png_set_swap_alpha(png_ptr);
+            }
+	}
+	else
+	{
+	    /* alpha as byte 3 check if byte 0 is blue ifso flip RGB to BGR */
+	    if (pc[0] == 3)
+	        png_set_bgr(png_ptr);
+            /* do we have an alpha channel? */
+            if ((bpp == 32) && (pc[3] != 7))
+                fprintf(stderr, "loadpng: warning, png has alpha channel but allegro not in color_depth with an alpha channel!\n");
+	}
     }
 
     /* Read the image, one line at a line (easier to debug!) */


Index: raidem.spec
===================================================================
RCS file: /cvs/extras/rpms/raidem/devel/raidem.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- raidem.spec	6 Apr 2006 11:53:48 -0000	1.3
+++ raidem.spec	6 Apr 2006 20:26:44 -0000	1.4
@@ -1,6 +1,6 @@
 Name:           raidem
 Version:        0.3
-Release:        unreleased(to become 2)%{?dist}
+Release:        2%{?dist}
 Summary:        2d top-down shoot'em up
 Group:          Amusements/Games
 License:        zlib License
@@ -13,6 +13,7 @@
 Patch0:         raidem-0.3-no-mp3.patch
 Patch1:         raidem-0.3-syslibs.patch
 Patch2:         raidem-0.3-warn.patch
+Patch3:         raidem-0.3-loadpng.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  gcc-objc glyph-keeper-devel freetype-devel adime-devel
 BuildRequires:  zziplib-devel libpng-devel desktop-file-utils
@@ -31,6 +32,7 @@
 %patch0 -p1 -z .no_mp3
 %patch1 -p1 -z .syslibs
 %patch2 -p1 -z .warn
+%patch3 -p1 -z .loadpng
 # remove all included system libs, to avoid using the included system headers.
 mv lib/loadpng .
 rm -fr lib/*
@@ -92,9 +94,11 @@
 
 
 %changelog
-* Sun Apr  2 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 0.3-unreleased
+* Sun Apr  2 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 0.3-2
 - Add missing RPM_OPT_FLAGS to CFLAGS
 - Add missing -D__LINUX__ to CFLAGS with this patch2 is no longer needed
+- Add -fsigned-char to CFLAGS this fixes crashing on startup on PPC (bz 185850)
+- Add Patch3 which fixes funky colors on PPC (bz 185850)
 
 * Sat Mar 12 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 0.3-1
 - Initial Fedora Extras package




More information about the fedora-extras-commits mailing list