aboutsummaryrefslogtreecommitdiff
path: root/games/openra
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2014-11-28 11:52:44 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2014-11-28 11:52:44 +0000
commitda777518f2975713788833ba15129ea9f3fbaa58 (patch)
tree30497aaa6ecb13e57a39d6bada8bbda825289b2e /games/openra
parent5f19ee0628d16835327bd7d4f9c15cd088914e53 (diff)
Notes
Diffstat (limited to 'games/openra')
-rw-r--r--games/openra/Makefile1
-rw-r--r--games/openra/files/patch-xamarin-bug2331945
2 files changed, 36 insertions, 10 deletions
diff --git a/games/openra/Makefile b/games/openra/Makefile
index 079276afacf0..f87b8bdc5e9e 100644
--- a/games/openra/Makefile
+++ b/games/openra/Makefile
@@ -2,6 +2,7 @@
PORTNAME= openra
PORTVERSION= 20141029
+PORTREVISION= 1
CATEGORIES= games
MAINTAINER= jbeich@vfemail.net
diff --git a/games/openra/files/patch-xamarin-bug23319 b/games/openra/files/patch-xamarin-bug23319
index ac51c4bd7298..6251b4bb91e4 100644
--- a/games/openra/files/patch-xamarin-bug23319
+++ b/games/openra/files/patch-xamarin-bug23319
@@ -1,25 +1,50 @@
-# https://bugzilla.xamarin.com/show_bug.cgi?id=23319
-# https://github.com/mono/mono/commit/1d94d17
+commit 04cbea3
+Author: Gordon Martin <gordonhughmartin@gmail.com>
+Date: Tue Nov 11 13:35:49 2014 +0000
---- OpenRA.Game/Exts.cs~
+ Desugaring a couple of ternary expressions which prevented OpenRA building on Mono 3.10 and certain versions of the 3.8 series due to a bug in Mono: https://bugzilla.xamarin.com/show_bug.cgi?id=23319
+---
+ OpenRA.Game/Exts.cs | 8 ++++++--
+ OpenRA.Mods.RA/Render/WithMuzzleFlash.cs | 10 ++++++++--
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git OpenRA.Game/Exts.cs OpenRA.Game/Exts.cs
+index 19d177a..0faf5af 100644
+--- OpenRA.Game/Exts.cs
+++ OpenRA.Game/Exts.cs
-@@ -375,7 +375,7 @@ namespace OpenRA
+@@ -374,8 +374,12 @@ public static T[] MakeArray<T>(int count, Func<int, T> f)
+ var result = new T[width, height];
for (var i = 0; i < width; i++)
for (var j = 0; j < height; j++)
- result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
+- result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
- ? ts[i, j] : t;
-+ ? (ts[i, j]) : t;
++ // Workaround for broken ternary operators in certain versions of mono (3.10 and
++ // certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319
++ if (i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1))
++ result[i, j] = ts[i, j];
++ else
++ result[i, j] = t;
return result;
}
---- OpenRA.Mods.RA/Render/WithMuzzleFlash.cs~
+diff --git OpenRA.Mods.RA/Render/WithMuzzleFlash.cs OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
+index 2db391a..40a59d9 100644
+--- OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
+++ OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
-@@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Render
+@@ -51,8 +51,14 @@ public WithMuzzleFlash(Actor self, WithMuzzleFlashInfo info)
var turreted = self.TraitsImplementing<Turreted>()
.FirstOrDefault(t => t.Name == arm.Info.Turret);
- getFacing = turreted != null ? () => turreted.TurretFacing :
-+ getFacing = turreted != null ? (() => turreted.TurretFacing) :
- facing != null ? (Func<int>)(() => facing.Facing) : () => 0;
+- facing != null ? (Func<int>)(() => facing.Facing) : () => 0;
++ // Workaround for broken ternary operators in certain versions of mono (3.10 and
++ // certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319
++ if (turreted != null)
++ getFacing = () => turreted.TurretFacing;
++ else if (facing != null)
++ getFacing = (Func<int>)(() => facing.Facing);
++ else
++ getFacing = () => 0;
var muzzleFlash = new Animation(self.World, render.GetImage(self), getFacing);
+ visible.Add(barrel, false);