rpms/raidem/FC-5 raidem-0.3-loadpng.patch, NONE, 1.1 raidem.spec, 1.2, 1.3 raidem-0.3-datapath.patch, 1.1, NONE

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


Author: jwrdegoede

Update of /cvs/extras/rpms/raidem/FC-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14804

Modified Files:
	raidem.spec 
Added Files:
	raidem-0.3-loadpng.patch 
Removed Files:
	raidem-0.3-datapath.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/FC-5/raidem.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- raidem.spec	15 Mar 2006 19:28:21 -0000	1.2
+++ raidem.spec	6 Apr 2006 20:28:50 -0000	1.3
@@ -1,6 +1,6 @@
 Name:           raidem
 Version:        0.3
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        2d top-down shoot'em up
 Group:          Amusements/Games
 License:        zlib License
@@ -12,8 +12,8 @@
 Source2:        raidem.desktop
 Patch0:         raidem-0.3-no-mp3.patch
 Patch1:         raidem-0.3-syslibs.patch
-Patch2:         raidem-0.3-datapath.patch
-Patch3:         raidem-0.3-warn.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,8 +31,8 @@
 %setup -q -n %{name}-%{version}-src
 %patch0 -p1 -z .no_mp3
 %patch1 -p1 -z .syslibs
-%patch2 -p1 -z .datapath
-%patch3 -p1 -z .warn
+%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/*
@@ -41,8 +41,8 @@
 
 %build
 make %{?_smp_mflags} lib/loadpng/libldpng.a raid \
-  CFLAGS="-Iinclude -Ilib -DNO_MP3 -DNO_ID3TAGS -DNO_FBLEND \
-    -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -DITOUCH \
+  CFLAGS="$RPM_OPT_FLAGS -fsigned-char -Iinclude -Ilib -D__LINUX__ -DNO_MP3 \
+    -DNO_ID3TAGS -DNO_FBLEND -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -DITOUCH \
     -DRAIDEM_DATA_DIR=\\\"%{_datadir}/%{name}/\\\"" \
   LDLIBS="-lglyph-alleg `freetype-config --libs` lib/loadpng/libldpng.a -lpng \
     -lzzip -ladime `allegro-config --libs` -lz -lpthread -lobjc"
@@ -94,5 +94,11 @@
 
 
 %changelog
+* 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


--- raidem-0.3-datapath.patch DELETED ---




More information about the fedora-extras-commits mailing list