rpms/bzflag/F-8 bzflag-2.0.12-findresolutions.patch, NONE, 1.1 bzflag.spec, 1.41, 1.42

Nils Philippsen (nphilipp) fedora-extras-commits at redhat.com
Thu Jul 10 08:14:05 UTC 2008


Author: nphilipp

Update of /cvs/pkgs/rpms/bzflag/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1331

Modified Files:
	bzflag.spec 
Added Files:
	bzflag-2.0.12-findresolutions.patch 
Log Message:
build with SDL, but fix finding resolutions (#426011)


bzflag-2.0.12-findresolutions.patch:

--- NEW FILE bzflag-2.0.12-findresolutions.patch ---
diff -up bzflag-2.0.12/src/platform/BzfDisplay.cxx.findresolutions bzflag-2.0.12/src/platform/BzfDisplay.cxx
--- bzflag-2.0.12/src/platform/BzfDisplay.cxx.findresolutions	2008-04-06 07:30:37.000000000 +0200
+++ bzflag-2.0.12/src/platform/BzfDisplay.cxx	2008-07-10 10:05:41.000000000 +0200
@@ -137,9 +137,20 @@ bool			BzfDisplay::doSetDefaultResolutio
 
 int			BzfDisplay::findResolution(const char* name) const
 {
-  for (int i = 0; i < numResolutions; i++)
-    if (strcmp(name, resolutions[i]->name) == 0)
+  for (int i = 0; i < numResolutions; i++) {
+    // only compare up to first space character
+    const char *cp1, *cp2;
+    int i1, i2;
+
+    cp1 = strstr (name, " ");
+    cp2 = strstr (resolutions[i]->name, " ");
+
+    i1 = cp1 ? (cp1 - name) : strlen (name);
+    i2 = cp2 ? (cp2 - resolutions[i]->name) : strlen (resolutions[i]->name);
+
+    if ((i1 == i2) && (strncmp(name, resolutions[i]->name, i1 + 1) == 0))
       return i;
+  }
   return -1;
 }
 


Index: bzflag.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bzflag/F-8/bzflag.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- bzflag.spec	9 Jul 2008 10:10:00 -0000	1.41
+++ bzflag.spec	10 Jul 2008 08:12:47 -0000	1.42
@@ -2,7 +2,7 @@
 # --with/--without options:
 # modular_x: rebuild with modular X deps
 # opengl_wrapper: use Fedora OpenGL wrapper
-# SDL: use SDL instead of X11 directly
+# SDL: use SDL (instead of accessing X11, sound devices directly)
 
 #### default options:
 %if %{?fedora}%{!?fedora:5} < 5
@@ -25,9 +25,7 @@
 %define _libcurl_devel 0
 %endif
 
-# don't build with SDL by default because of display resolution setting
-# problems
-%bcond_with SDL
+%bcond_without SDL
 
 %define desktop_vendor fedora
 #define date           20050930
@@ -35,14 +33,15 @@
 Summary: 3D multi-player tank battle game
 Name: bzflag
 Version: 2.0.12
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: LGPLv2
 Group: Amusements/Games
 URL: http://bzflag.org
 Source0: http://downloads.sourceforge.net/bzflag/bzflag-%{version}%{?date:.%{date}}.tar.bz2
 Source1: bzflag.desktop
 Patch0: bzflag-2.0.4-lookup.patch
-Patch2: bzflag-2.0.10-gcc-4.3.patch
+Patch1: bzflag-2.0.10-gcc-4.3.patch
+Patch2: bzflag-2.0.12-findresolutions.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
 %if %{with modular_x}
 BuildRequires: libXi-devel
@@ -90,7 +89,8 @@
 %prep
 %setup -q -n %{name}-%{version}%{?date:.%{date}}
 %patch0 -p1 -b .lookup
-%patch2 -p1 -b .gcc-4.3
+%patch1 -p1 -b .gcc-4.3
+%patch2 -p1 -b .findresolutions
 
 %build
 autoreconf
@@ -146,6 +146,9 @@
 %{_mandir}/man*/*
 
 %changelog
+* Thu Jul 09 2008 Nils Philippsen <nphilipp at redhat.com> 2.0.12-3
+- build with SDL, but fix finding resolutions (#426011)
+
 * Wed Jul 08 2008 Nils Philippsen <nphilipp at redhat.com> 2.0.12-2
 - build without SDL (#426011)
 




More information about the scm-commits mailing list