aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-01 21:54:04 +0000
committerMelanie Thielker2008-09-01 21:54:04 +0000
commitbfeb3881f2f5ea52b38864bcc679390623613da0 (patch)
tree5487ceeba8ce1fc78d32533e77ade285dcc3fa7c /OpenSim/Region/ScriptEngine/Shared
parentMantis #2095 (diff)
downloadopensim-SC_OLD-bfeb3881f2f5ea52b38864bcc679390623613da0.zip
opensim-SC_OLD-bfeb3881f2f5ea52b38864bcc679390623613da0.tar.gz
opensim-SC_OLD-bfeb3881f2f5ea52b38864bcc679390623613da0.tar.bz2
opensim-SC_OLD-bfeb3881f2f5ea52b38864bcc679390623613da0.tar.xz
Another attempt at fixing XEngine llSetPrimitiveParams: Make it accept
LSLIntegers in lists, and attempt to address the scope issue on TRUE and FALSE with readonly static linkage
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs48
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs4
2 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b5ca167..a8c74ac 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5509,7 +5509,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5509 5509
5510 while (idx < rules.Length) 5510 while (idx < rules.Length)
5511 { 5511 {
5512 int code = Convert.ToInt32(rules.Data[idx++]); 5512 int code = Convert.ToInt32(rules.Data[idx++].ToString());
5513 5513
5514 int remain = rules.Length - idx; 5514 int remain = rules.Length - idx;
5515 5515
@@ -5547,7 +5547,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5547 if (remain < 3) 5547 if (remain < 3)
5548 return; 5548 return;
5549 5549
5550 code = Convert.ToInt32(rules.Data[idx++]); 5550 code = Convert.ToInt32(rules.Data[idx++].ToString());
5551 5551
5552 remain = rules.Length - idx; 5552 remain = rules.Length - idx;
5553 float hollow; 5553 float hollow;
@@ -5566,7 +5566,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5566 if (remain < 6) 5566 if (remain < 6)
5567 return; 5567 return;
5568 5568
5569 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5569 face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
5570 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut 5570 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut
5571 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5571 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5572 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5572 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5580,7 +5580,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5580 if (remain < 6) 5580 if (remain < 6)
5581 return; 5581 return;
5582 5582
5583 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5583 face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
5584 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut 5584 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut
5585 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5585 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5586 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5586 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5595,7 +5595,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5595 if (remain < 6) 5595 if (remain < 6)
5596 return; 5596 return;
5597 5597
5598 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5598 face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
5599 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5599 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5600 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5600 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5601 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5601 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5609,7 +5609,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5609 if (remain < 5) 5609 if (remain < 5)
5610 return; 5610 return;
5611 5611
5612 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5612 face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
5613 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut 5613 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut
5614 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5614 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5615 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5615 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5622,7 +5622,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5622 if (remain < 11) 5622 if (remain < 11)
5623 return; 5623 return;
5624 5624
5625 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5625 face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
5626 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5626 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5627 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5627 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5628 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5628 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5641,7 +5641,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5641 if (remain < 11) 5641 if (remain < 11)
5642 return; 5642 return;
5643 5643
5644 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5644 face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
5645 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5645 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5646 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5646 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5647 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5647 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5660,7 +5660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5660 if (remain < 11) 5660 if (remain < 11)
5661 return; 5661 return;
5662 5662
5663 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5663 face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
5664 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5664 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5665 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5665 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5666 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5666 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5680,7 +5680,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5680 return; 5680 return;
5681 5681
5682 string map = rules.Data[idx++].ToString(); 5682 string map = rules.Data[idx++].ToString();
5683 face = Convert.ToInt32(rules.Data[idx++]); // type 5683 face = Convert.ToInt32(rules.Data[idx++].ToString()); // type
5684 m_host.Shape.PathCurve = (byte) Extrusion.Curve1; 5684 m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
5685 SetPrimitiveShapeParams(map, face); 5685 SetPrimitiveShapeParams(map, face);
5686 break; 5686 break;
@@ -5692,7 +5692,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5692 if (remain < 5) 5692 if (remain < 5)
5693 return; 5693 return;
5694 5694
5695 face=Convert.ToInt32(rules.Data[idx++]); 5695 face=Convert.ToInt32(rules.Data[idx++].ToString());
5696 string tex=rules.Data[idx++].ToString(); 5696 string tex=rules.Data[idx++].ToString();
5697 LSL_Types.Vector3 repeats=new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5697 LSL_Types.Vector3 repeats=new LSL_Types.Vector3(rules.Data[idx++].ToString());
5698 LSL_Types.Vector3 offsets=new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5698 LSL_Types.Vector3 offsets=new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5709,7 +5709,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5709 if (remain < 3) 5709 if (remain < 3)
5710 return; 5710 return;
5711 5711
5712 face=Convert.ToInt32(rules.Data[idx++]); 5712 face=Convert.ToInt32(rules.Data[idx++].ToString());
5713 LSL_Types.Vector3 color=new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5713 LSL_Types.Vector3 color=new LSL_Types.Vector3(rules.Data[idx++].ToString());
5714 double alpha=Convert.ToDouble(rules.Data[idx++]); 5714 double alpha=Convert.ToDouble(rules.Data[idx++]);
5715 5715
@@ -5721,8 +5721,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5721 if (remain < 7) 5721 if (remain < 7)
5722 return; 5722 return;
5723 5723
5724 int flexi = Convert.ToInt32(rules.Data[idx++]); 5724 int flexi = Convert.ToInt32(rules.Data[idx++].ToString());
5725 int softness = Convert.ToInt32(rules.Data[idx++]); 5725 int softness = Convert.ToInt32(rules.Data[idx++].ToString());
5726 float gravity = (float)Convert.ToDouble(rules.Data[idx++]); 5726 float gravity = (float)Convert.ToDouble(rules.Data[idx++]);
5727 float friction = (float)Convert.ToDouble(rules.Data[idx++]); 5727 float friction = (float)Convert.ToDouble(rules.Data[idx++]);
5728 float wind = (float)Convert.ToDouble(rules.Data[idx++]); 5728 float wind = (float)Convert.ToDouble(rules.Data[idx++]);
@@ -5747,7 +5747,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5747 case (int)ScriptBaseClass.PRIM_GLOW: 5747 case (int)ScriptBaseClass.PRIM_GLOW:
5748 if (remain < 2) 5748 if (remain < 2)
5749 return; 5749 return;
5750 face = Convert.ToInt32(rules.Data[idx++]); 5750 face = Convert.ToInt32(rules.Data[idx++].ToString());
5751 float glow = (float)Convert.ToDouble(rules.Data[idx++]); 5751 float glow = (float)Convert.ToDouble(rules.Data[idx++]);
5752 5752
5753 SetGlow(part, face, glow); 5753 SetGlow(part, face, glow);
@@ -5756,8 +5756,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5756 case (int)ScriptBaseClass.PRIM_BUMP_SHINY: 5756 case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
5757 if (remain < 3) 5757 if (remain < 3)
5758 return; 5758 return;
5759 face = Convert.ToInt32(rules.Data[idx++]); 5759 face = Convert.ToInt32(rules.Data[idx++].ToString());
5760 int shiny = Convert.ToInt32(rules.Data[idx++]); 5760 int shiny = Convert.ToInt32(rules.Data[idx++].ToString());
5761 Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); 5761 Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]);
5762 5762
5763 SetShiny(part, face, shiny, bump); 5763 SetShiny(part, face, shiny, bump);
@@ -5766,7 +5766,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5766 case (int)ScriptBaseClass.PRIM_FULLBRIGHT: 5766 case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
5767 if (remain < 2) 5767 if (remain < 2)
5768 return; 5768 return;
5769 face = Convert.ToInt32(rules.Data[idx++]); 5769 face = Convert.ToInt32(rules.Data[idx++].ToString());
5770 string bv = rules.Data[idx++].ToString(); 5770 string bv = rules.Data[idx++].ToString();
5771 bool st; 5771 bool st;
5772 if (bv.Equals("1")) 5772 if (bv.Equals("1"))
@@ -6071,7 +6071,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6071 int idx=0; 6071 int idx=0;
6072 while (idx < rules.Length) 6072 while (idx < rules.Length)
6073 { 6073 {
6074 int code=Convert.ToInt32(rules.Data[idx++]); 6074 int code=Convert.ToInt32(rules.Data[idx++].ToString());
6075 int remain=rules.Length-idx; 6075 int remain=rules.Length-idx;
6076 6076
6077 switch (code) 6077 switch (code)
@@ -6236,7 +6236,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6236 if (remain < 1) 6236 if (remain < 1)
6237 return res; 6237 return res;
6238 6238
6239 face=Convert.ToInt32(rules.Data[idx++]); 6239 face=Convert.ToInt32(rules.Data[idx++].ToString());
6240 6240
6241 res.Add(new LSL_Types.LSLInteger(0)); 6241 res.Add(new LSL_Types.LSLInteger(0));
6242 res.Add(new LSL_Types.LSLInteger(0)); 6242 res.Add(new LSL_Types.LSLInteger(0));
@@ -6247,7 +6247,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6247 if (remain < 1) 6247 if (remain < 1)
6248 return res; 6248 return res;
6249 6249
6250 face=Convert.ToInt32(rules.Data[idx++]); 6250 face=Convert.ToInt32(rules.Data[idx++].ToString());
6251 6251
6252 res.Add(new LSL_Types.LSLInteger(0)); 6252 res.Add(new LSL_Types.LSLInteger(0));
6253 break; 6253 break;
@@ -6275,7 +6275,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6275 if (remain < 1) 6275 if (remain < 1)
6276 return res; 6276 return res;
6277 6277
6278 face=Convert.ToInt32(rules.Data[idx++]); 6278 face=Convert.ToInt32(rules.Data[idx++].ToString());
6279 6279
6280 res.Add(new LSL_Types.LSLInteger(0)); 6280 res.Add(new LSL_Types.LSLInteger(0));
6281 break; 6281 break;
@@ -6300,7 +6300,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6300 if (remain < 1) 6300 if (remain < 1)
6301 return res; 6301 return res;
6302 6302
6303 face=Convert.ToInt32(rules.Data[idx++]); 6303 face=Convert.ToInt32(rules.Data[idx++].ToString());
6304 6304
6305 res.Add(new LSL_Types.LSLFloat(0)); 6305 res.Add(new LSL_Types.LSLFloat(0));
6306 break; 6306 break;
@@ -7387,7 +7387,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7387 SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); 7387 SortedDictionary<int, float> parameters = new SortedDictionary<int, float>();
7388 object[] data = rules.Data; 7388 object[] data = rules.Data;
7389 for (int i = 0; i < data.Length; ++i) { 7389 for (int i = 0; i < data.Length; ++i) {
7390 int type = Convert.ToInt32(data[i++]); 7390 int type = Convert.ToInt32(data[i++].ToString());
7391 if (i >= data.Length) break; // odd number of entries => ignore the last 7391 if (i >= data.Length) break; // odd number of entries => ignore the last
7392 7392
7393 // some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3) 7393 // some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 739e168..e3b81b7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -35,8 +35,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
35 public partial class ScriptBaseClass : MarshalByRefObject 35 public partial class ScriptBaseClass : MarshalByRefObject
36 { 36 {
37 // LSL CONSTANTS 37 // LSL CONSTANTS
38 public LSLInteger TRUE = new LSLInteger(1); 38 public static readonly LSLInteger TRUE = new LSLInteger(1);
39 public LSLInteger FALSE = new LSLInteger(0); 39 public static readonly LSLInteger FALSE = new LSLInteger(0);
40 40
41 public const int STATUS_PHYSICS = 1; 41 public const int STATUS_PHYSICS = 1;
42 public const int STATUS_ROTATE_X = 2; 42 public const int STATUS_ROTATE_X = 2;