diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/PrimitiveBaseShape.cs | 28 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 27 |
2 files changed, 48 insertions, 7 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 20b9cf1..9a38f23 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -708,7 +708,12 @@ namespace OpenSim.Framework | |||
708 | return _lightColorR; | 708 | return _lightColorR; |
709 | } | 709 | } |
710 | set { | 710 | set { |
711 | _lightColorR = value; | 711 | if (value < 0) |
712 | _lightColorR = 0; | ||
713 | else if (value > 1.0f) | ||
714 | _lightColorR = 1.0f; | ||
715 | else | ||
716 | _lightColorR = value; | ||
712 | } | 717 | } |
713 | } | 718 | } |
714 | 719 | ||
@@ -717,7 +722,12 @@ namespace OpenSim.Framework | |||
717 | return _lightColorG; | 722 | return _lightColorG; |
718 | } | 723 | } |
719 | set { | 724 | set { |
720 | _lightColorG = value; | 725 | if (value < 0) |
726 | _lightColorG = 0; | ||
727 | else if (value > 1.0f) | ||
728 | _lightColorG = 1.0f; | ||
729 | else | ||
730 | _lightColorG = value; | ||
721 | } | 731 | } |
722 | } | 732 | } |
723 | 733 | ||
@@ -726,7 +736,12 @@ namespace OpenSim.Framework | |||
726 | return _lightColorB; | 736 | return _lightColorB; |
727 | } | 737 | } |
728 | set { | 738 | set { |
729 | _lightColorB = value; | 739 | if (value < 0) |
740 | _lightColorB = 0; | ||
741 | else if (value > 1.0f) | ||
742 | _lightColorB = 1.0f; | ||
743 | else | ||
744 | _lightColorB = value; | ||
730 | } | 745 | } |
731 | } | 746 | } |
732 | 747 | ||
@@ -735,7 +750,12 @@ namespace OpenSim.Framework | |||
735 | return _lightColorA; | 750 | return _lightColorA; |
736 | } | 751 | } |
737 | set { | 752 | set { |
738 | _lightColorA = value; | 753 | if (value < 0) |
754 | _lightColorA = 0; | ||
755 | else if (value > 1.0f) | ||
756 | _lightColorA = 1.0f; | ||
757 | else | ||
758 | _lightColorA = value; | ||
739 | } | 759 | } |
740 | } | 760 | } |
741 | 761 | ||
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 877b0c2..cef756c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -46,7 +46,7 @@ using System.Threading; | |||
46 | using log4net; | 46 | using log4net; |
47 | using Nini.Config; | 47 | using Nini.Config; |
48 | using Nwc.XmlRpc; | 48 | using Nwc.XmlRpc; |
49 | using BclExtras; | 49 | // using BclExtras; |
50 | using OpenMetaverse; | 50 | using OpenMetaverse; |
51 | using OpenMetaverse.StructuredData; | 51 | using OpenMetaverse.StructuredData; |
52 | using Amib.Threading; | 52 | using Amib.Threading; |
@@ -1375,8 +1375,29 @@ namespace OpenSim.Framework | |||
1375 | /// <summary> | 1375 | /// <summary> |
1376 | /// Created to work around a limitation in Mono with nested delegates | 1376 | /// Created to work around a limitation in Mono with nested delegates |
1377 | /// </summary> | 1377 | /// </summary> |
1378 | private class FireAndForgetWrapper | 1378 | private sealed class FireAndForgetWrapper |
1379 | { | 1379 | { |
1380 | private static volatile FireAndForgetWrapper instance; | ||
1381 | private static object syncRoot = new Object(); | ||
1382 | |||
1383 | public static FireAndForgetWrapper Instance { | ||
1384 | get { | ||
1385 | |||
1386 | if (instance == null) | ||
1387 | { | ||
1388 | lock (syncRoot) | ||
1389 | { | ||
1390 | if (instance == null) | ||
1391 | { | ||
1392 | instance = new FireAndForgetWrapper(); | ||
1393 | } | ||
1394 | } | ||
1395 | } | ||
1396 | |||
1397 | return instance; | ||
1398 | } | ||
1399 | } | ||
1400 | |||
1380 | public void FireAndForget(System.Threading.WaitCallback callback) | 1401 | public void FireAndForget(System.Threading.WaitCallback callback) |
1381 | { | 1402 | { |
1382 | callback.BeginInvoke(null, EndFireAndForget, callback); | 1403 | callback.BeginInvoke(null, EndFireAndForget, callback); |
@@ -1445,7 +1466,7 @@ namespace OpenSim.Framework | |||
1445 | ThreadPool.QueueUserWorkItem(callback, obj); | 1466 | ThreadPool.QueueUserWorkItem(callback, obj); |
1446 | break; | 1467 | break; |
1447 | case FireAndForgetMethod.BeginInvoke: | 1468 | case FireAndForgetMethod.BeginInvoke: |
1448 | FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>(); | 1469 | FireAndForgetWrapper wrapper = FireAndForgetWrapper.Instance; |
1449 | wrapper.FireAndForget(callback, obj); | 1470 | wrapper.FireAndForget(callback, obj); |
1450 | break; | 1471 | break; |
1451 | case FireAndForgetMethod.SmartThreadPool: | 1472 | case FireAndForgetMethod.SmartThreadPool: |