diff options
author | UbitUmarov | 2018-03-05 16:39:17 +0000 |
---|---|---|
committer | UbitUmarov | 2018-03-05 16:39:17 +0000 |
commit | dc5cd9a3ae597f6c9d663cd4499263bf3c127608 (patch) | |
tree | 13cb68b9a737508016f537d5f9416d84260233c5 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Yengine: change filename extentions on scripts state (better delete contents ... (diff) | |
parent | make more clear some magic numbers on SOP getnumberofsides(), reduce unneces... (diff) | |
download | opensim-SC-dc5cd9a3ae597f6c9d663cd4499263bf3c127608.zip opensim-SC-dc5cd9a3ae597f6c9d663cd4499263bf3c127608.tar.gz opensim-SC-dc5cd9a3ae597f6c9d663cd4499263bf3c127608.tar.bz2 opensim-SC-dc5cd9a3ae597f6c9d663cd4499263bf3c127608.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 118 |
1 files changed, 69 insertions, 49 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3f72e6a..b9f8b28 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1933,8 +1933,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1933 | return; | 1933 | return; |
1934 | 1934 | ||
1935 | Primitive.TextureEntry tex = part.Shape.Textures; | 1935 | Primitive.TextureEntry tex = part.Shape.Textures; |
1936 | int nsides = GetNumberOfSides(part); | ||
1936 | Color4 texcolor; | 1937 | Color4 texcolor; |
1937 | if (face >= 0 && face < GetNumberOfSides(part)) | 1938 | |
1939 | if (face >= 0 && face < nsides) | ||
1938 | { | 1940 | { |
1939 | texcolor = tex.CreateFace((uint)face).RGBA; | 1941 | texcolor = tex.CreateFace((uint)face).RGBA; |
1940 | texcolor.R = Util.Clip((float)color.x, 0.0f, 1.0f); | 1942 | texcolor.R = Util.Clip((float)color.x, 0.0f, 1.0f); |
@@ -1945,8 +1947,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1945 | return; | 1947 | return; |
1946 | } | 1948 | } |
1947 | else if (face == ScriptBaseClass.ALL_SIDES) | 1949 | else if (face == ScriptBaseClass.ALL_SIDES) |
1948 | { | 1950 | { |
1949 | for (uint i = 0; i < GetNumberOfSides(part); i++) | 1951 | for (uint i = 0; i < nsides; i++) |
1950 | { | 1952 | { |
1951 | if (tex.FaceTextures[i] != null) | 1953 | if (tex.FaceTextures[i] != null) |
1952 | { | 1954 | { |
@@ -2063,7 +2065,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2063 | if (style == (int)ScriptBaseClass.PRIM_TEXGEN_PLANAR) | 2065 | if (style == (int)ScriptBaseClass.PRIM_TEXGEN_PLANAR) |
2064 | textype = MappingType.Planar; | 2066 | textype = MappingType.Planar; |
2065 | 2067 | ||
2066 | if (face >= 0 && face < GetNumberOfSides(part)) | 2068 | int nsides = GetNumberOfSides(part); |
2069 | |||
2070 | if (face >= 0 && face < nsides) | ||
2067 | { | 2071 | { |
2068 | tex.CreateFace((uint) face); | 2072 | tex.CreateFace((uint) face); |
2069 | tex.FaceTextures[face].TexMapType = textype; | 2073 | tex.FaceTextures[face].TexMapType = textype; |
@@ -2072,7 +2076,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2072 | } | 2076 | } |
2073 | else if (face == ScriptBaseClass.ALL_SIDES) | 2077 | else if (face == ScriptBaseClass.ALL_SIDES) |
2074 | { | 2078 | { |
2075 | for (uint i = 0; i < GetNumberOfSides(part); i++) | 2079 | for (uint i = 0; i < nsides; i++) |
2076 | { | 2080 | { |
2077 | if (tex.FaceTextures[i] != null) | 2081 | if (tex.FaceTextures[i] != null) |
2078 | { | 2082 | { |
@@ -2091,7 +2095,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2091 | return; | 2095 | return; |
2092 | 2096 | ||
2093 | Primitive.TextureEntry tex = part.Shape.Textures; | 2097 | Primitive.TextureEntry tex = part.Shape.Textures; |
2094 | if (face >= 0 && face < GetNumberOfSides(part)) | 2098 | int nsides = GetNumberOfSides(part); |
2099 | |||
2100 | if (face >= 0 && face < nsides) | ||
2095 | { | 2101 | { |
2096 | tex.CreateFace((uint) face); | 2102 | tex.CreateFace((uint) face); |
2097 | tex.FaceTextures[face].Glow = glow; | 2103 | tex.FaceTextures[face].Glow = glow; |
@@ -2100,7 +2106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2100 | } | 2106 | } |
2101 | else if (face == ScriptBaseClass.ALL_SIDES) | 2107 | else if (face == ScriptBaseClass.ALL_SIDES) |
2102 | { | 2108 | { |
2103 | for (uint i = 0; i < GetNumberOfSides(part); i++) | 2109 | for (uint i = 0; i < nsides; i++) |
2104 | { | 2110 | { |
2105 | if (tex.FaceTextures[i] != null) | 2111 | if (tex.FaceTextures[i] != null) |
2106 | { | 2112 | { |
@@ -2139,8 +2145,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2139 | break; | 2145 | break; |
2140 | } | 2146 | } |
2141 | 2147 | ||
2148 | int nsides = GetNumberOfSides(part); | ||
2149 | |||
2142 | Primitive.TextureEntry tex = part.Shape.Textures; | 2150 | Primitive.TextureEntry tex = part.Shape.Textures; |
2143 | if (face >= 0 && face < GetNumberOfSides(part)) | 2151 | if (face >= 0 && face < nsides) |
2144 | { | 2152 | { |
2145 | tex.CreateFace((uint) face); | 2153 | tex.CreateFace((uint) face); |
2146 | tex.FaceTextures[face].Shiny = sval; | 2154 | tex.FaceTextures[face].Shiny = sval; |
@@ -2150,7 +2158,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2150 | } | 2158 | } |
2151 | else if (face == ScriptBaseClass.ALL_SIDES) | 2159 | else if (face == ScriptBaseClass.ALL_SIDES) |
2152 | { | 2160 | { |
2153 | for (uint i = 0; i < GetNumberOfSides(part); i++) | 2161 | for (uint i = 0; i < nsides; i++) |
2154 | { | 2162 | { |
2155 | if (tex.FaceTextures[i] != null) | 2163 | if (tex.FaceTextures[i] != null) |
2156 | { | 2164 | { |
@@ -2170,8 +2178,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2170 | if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) | 2178 | if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) |
2171 | return; | 2179 | return; |
2172 | 2180 | ||
2181 | int nsides = GetNumberOfSides(part); | ||
2173 | Primitive.TextureEntry tex = part.Shape.Textures; | 2182 | Primitive.TextureEntry tex = part.Shape.Textures; |
2174 | if (face >= 0 && face < GetNumberOfSides(part)) | 2183 | if (face >= 0 && face < nsides) |
2175 | { | 2184 | { |
2176 | tex.CreateFace((uint) face); | 2185 | tex.CreateFace((uint) face); |
2177 | tex.FaceTextures[face].Fullbright = bright; | 2186 | tex.FaceTextures[face].Fullbright = bright; |
@@ -2180,7 +2189,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2180 | } | 2189 | } |
2181 | else if (face == ScriptBaseClass.ALL_SIDES) | 2190 | else if (face == ScriptBaseClass.ALL_SIDES) |
2182 | { | 2191 | { |
2183 | for (uint i = 0; i < GetNumberOfSides(part); i++) | 2192 | for (uint i = 0; i < nsides; i++) |
2184 | { | 2193 | { |
2185 | if (tex.FaceTextures[i] != null) | 2194 | if (tex.FaceTextures[i] != null) |
2186 | { | 2195 | { |
@@ -2203,15 +2212,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2203 | protected LSL_Float GetAlpha(SceneObjectPart part, int face) | 2212 | protected LSL_Float GetAlpha(SceneObjectPart part, int face) |
2204 | { | 2213 | { |
2205 | Primitive.TextureEntry tex = part.Shape.Textures; | 2214 | Primitive.TextureEntry tex = part.Shape.Textures; |
2215 | int nsides = GetNumberOfSides(part); | ||
2206 | if (face == ScriptBaseClass.ALL_SIDES) | 2216 | if (face == ScriptBaseClass.ALL_SIDES) |
2207 | { | 2217 | { |
2208 | int i; | 2218 | int i; |
2209 | double sum = 0.0; | 2219 | double sum = 0.0; |
2210 | for (i = 0 ; i < GetNumberOfSides(part); i++) | 2220 | for (i = 0 ; i < nsides; i++) |
2211 | sum += (double)tex.GetFace((uint)i).RGBA.A; | 2221 | sum += (double)tex.GetFace((uint)i).RGBA.A; |
2212 | return sum; | 2222 | return sum; |
2213 | } | 2223 | } |
2214 | if (face >= 0 && face < GetNumberOfSides(part)) | 2224 | if (face >= 0 && face < nsides) |
2215 | { | 2225 | { |
2216 | return (double)tex.GetFace((uint)face).RGBA.A; | 2226 | return (double)tex.GetFace((uint)face).RGBA.A; |
2217 | } | 2227 | } |
@@ -2247,8 +2257,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2247 | return; | 2257 | return; |
2248 | 2258 | ||
2249 | Primitive.TextureEntry tex = part.Shape.Textures; | 2259 | Primitive.TextureEntry tex = part.Shape.Textures; |
2260 | int nsides = GetNumberOfSides(part); | ||
2250 | Color4 texcolor; | 2261 | Color4 texcolor; |
2251 | if (face >= 0 && face < GetNumberOfSides(part)) | 2262 | |
2263 | if (face >= 0 && face < nsides) | ||
2252 | { | 2264 | { |
2253 | texcolor = tex.CreateFace((uint)face).RGBA; | 2265 | texcolor = tex.CreateFace((uint)face).RGBA; |
2254 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | 2266 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); |
@@ -2258,7 +2270,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2258 | } | 2270 | } |
2259 | else if (face == ScriptBaseClass.ALL_SIDES) | 2271 | else if (face == ScriptBaseClass.ALL_SIDES) |
2260 | { | 2272 | { |
2261 | for (int i = 0; i < GetNumberOfSides(part); i++) | 2273 | for (int i = 0; i < nsides; i++) |
2262 | { | 2274 | { |
2263 | if (tex.FaceTextures[i] != null) | 2275 | if (tex.FaceTextures[i] != null) |
2264 | { | 2276 | { |
@@ -2446,9 +2458,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2446 | return; | 2458 | return; |
2447 | } | 2459 | } |
2448 | 2460 | ||
2461 | |||
2449 | Primitive.TextureEntry tex = part.Shape.Textures; | 2462 | Primitive.TextureEntry tex = part.Shape.Textures; |
2463 | int nsides = GetNumberOfSides(part); | ||
2450 | 2464 | ||
2451 | if (face >= 0 && face < GetNumberOfSides(part)) | 2465 | if (face >= 0 && face < nsides) |
2452 | { | 2466 | { |
2453 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); | 2467 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); |
2454 | texface.TextureID = textureID; | 2468 | texface.TextureID = textureID; |
@@ -2458,7 +2472,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2458 | } | 2472 | } |
2459 | else if (face == ScriptBaseClass.ALL_SIDES) | 2473 | else if (face == ScriptBaseClass.ALL_SIDES) |
2460 | { | 2474 | { |
2461 | for (uint i = 0; i < GetNumberOfSides(part); i++) | 2475 | for (uint i = 0; i < nsides; i++) |
2462 | { | 2476 | { |
2463 | if (tex.FaceTextures[i] != null) | 2477 | if (tex.FaceTextures[i] != null) |
2464 | { | 2478 | { |
@@ -2485,7 +2499,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2485 | return; | 2499 | return; |
2486 | 2500 | ||
2487 | Primitive.TextureEntry tex = part.Shape.Textures; | 2501 | Primitive.TextureEntry tex = part.Shape.Textures; |
2488 | if (face >= 0 && face < GetNumberOfSides(part)) | 2502 | int nsides = GetNumberOfSides(part); |
2503 | |||
2504 | if (face >= 0 && face < nsides) | ||
2489 | { | 2505 | { |
2490 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); | 2506 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); |
2491 | texface.RepeatU = (float)u; | 2507 | texface.RepeatU = (float)u; |
@@ -2496,7 +2512,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2496 | } | 2512 | } |
2497 | if (face == ScriptBaseClass.ALL_SIDES) | 2513 | if (face == ScriptBaseClass.ALL_SIDES) |
2498 | { | 2514 | { |
2499 | for (int i = 0; i < GetNumberOfSides(part); i++) | 2515 | for (int i = 0; i < nsides; i++) |
2500 | { | 2516 | { |
2501 | if (tex.FaceTextures[i] != null) | 2517 | if (tex.FaceTextures[i] != null) |
2502 | { | 2518 | { |
@@ -2524,7 +2540,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2524 | return; | 2540 | return; |
2525 | 2541 | ||
2526 | Primitive.TextureEntry tex = part.Shape.Textures; | 2542 | Primitive.TextureEntry tex = part.Shape.Textures; |
2527 | if (face >= 0 && face < GetNumberOfSides(part)) | 2543 | int nsides = GetNumberOfSides(part); |
2544 | |||
2545 | if (face >= 0 && face < nsides) | ||
2528 | { | 2546 | { |
2529 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); | 2547 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); |
2530 | texface.OffsetU = (float)u; | 2548 | texface.OffsetU = (float)u; |
@@ -2535,7 +2553,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2535 | } | 2553 | } |
2536 | if (face == ScriptBaseClass.ALL_SIDES) | 2554 | if (face == ScriptBaseClass.ALL_SIDES) |
2537 | { | 2555 | { |
2538 | for (int i = 0; i < GetNumberOfSides(part); i++) | 2556 | for (int i = 0; i < nsides; i++) |
2539 | { | 2557 | { |
2540 | if (tex.FaceTextures[i] != null) | 2558 | if (tex.FaceTextures[i] != null) |
2541 | { | 2559 | { |
@@ -2563,7 +2581,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2563 | return; | 2581 | return; |
2564 | 2582 | ||
2565 | Primitive.TextureEntry tex = part.Shape.Textures; | 2583 | Primitive.TextureEntry tex = part.Shape.Textures; |
2566 | if (face >= 0 && face < GetNumberOfSides(part)) | 2584 | int nsides = GetNumberOfSides(part); |
2585 | |||
2586 | if (face >= 0 && face < nsides) | ||
2567 | { | 2587 | { |
2568 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); | 2588 | Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); |
2569 | texface.Rotation = (float)rotation; | 2589 | texface.Rotation = (float)rotation; |
@@ -2573,7 +2593,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2573 | } | 2593 | } |
2574 | if (face == ScriptBaseClass.ALL_SIDES) | 2594 | if (face == ScriptBaseClass.ALL_SIDES) |
2575 | { | 2595 | { |
2576 | for (int i = 0; i < GetNumberOfSides(part); i++) | 2596 | for (int i = 0; i < nsides; i++) |
2577 | { | 2597 | { |
2578 | if (tex.FaceTextures[i] != null) | 2598 | if (tex.FaceTextures[i] != null) |
2579 | { | 2599 | { |
@@ -2595,12 +2615,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2595 | protected LSL_String GetTexture(SceneObjectPart part, int face) | 2615 | protected LSL_String GetTexture(SceneObjectPart part, int face) |
2596 | { | 2616 | { |
2597 | Primitive.TextureEntry tex = part.Shape.Textures; | 2617 | Primitive.TextureEntry tex = part.Shape.Textures; |
2618 | int nsides = GetNumberOfSides(part); | ||
2619 | |||
2598 | if (face == ScriptBaseClass.ALL_SIDES) | 2620 | if (face == ScriptBaseClass.ALL_SIDES) |
2599 | { | 2621 | { |
2600 | face = 0; | 2622 | face = 0; |
2601 | } | 2623 | } |
2602 | 2624 | ||
2603 | if (face >= 0 && face < GetNumberOfSides(part)) | 2625 | if (face >= 0 && face < nsides) |
2604 | { | 2626 | { |
2605 | Primitive.TextureEntryFace texface; | 2627 | Primitive.TextureEntryFace texface; |
2606 | texface = tex.GetFace((uint)face); | 2628 | texface = tex.GetFace((uint)face); |
@@ -5459,20 +5481,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5459 | { | 5481 | { |
5460 | m_host.AddScriptLPS(1); | 5482 | m_host.AddScriptLPS(1); |
5461 | 5483 | ||
5462 | return GetNumberOfSides(m_host); | 5484 | return m_host.GetNumberOfSides(); |
5463 | } | 5485 | } |
5464 | 5486 | ||
5465 | protected int GetNumberOfSides(SceneObjectPart part) | 5487 | protected int GetNumberOfSides(SceneObjectPart part) |
5466 | { | 5488 | { |
5467 | int sides = part.GetNumberOfSides(); | 5489 | return part.GetNumberOfSides(); |
5468 | |||
5469 | if (part.GetPrimType() == PrimType.SPHERE && part.Shape.ProfileHollow > 0) | ||
5470 | { | ||
5471 | // Make up for a bug where LSL shows 4 sides rather than 2 | ||
5472 | sides += 2; | ||
5473 | } | ||
5474 | |||
5475 | return sides; | ||
5476 | } | 5490 | } |
5477 | 5491 | ||
5478 | 5492 | ||
@@ -10844,6 +10858,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10844 | public LSL_List GetPrimParams(SceneObjectPart part, LSL_List rules, ref LSL_List res) | 10858 | public LSL_List GetPrimParams(SceneObjectPart part, LSL_List rules, ref LSL_List res) |
10845 | { | 10859 | { |
10846 | int idx = 0; | 10860 | int idx = 0; |
10861 | int face; | ||
10862 | Primitive.TextureEntry tex; | ||
10863 | int nsides = GetNumberOfSides(part); | ||
10864 | |||
10847 | while (idx < rules.Length) | 10865 | while (idx < rules.Length) |
10848 | { | 10866 | { |
10849 | int code = (int)rules.GetLSLIntegerItem(idx++); | 10867 | int code = (int)rules.GetLSLIntegerItem(idx++); |
@@ -10984,11 +11002,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10984 | if (remain < 1) | 11002 | if (remain < 1) |
10985 | return new LSL_List(); | 11003 | return new LSL_List(); |
10986 | 11004 | ||
10987 | int face = (int)rules.GetLSLIntegerItem(idx++); | 11005 | face = (int)rules.GetLSLIntegerItem(idx++); |
10988 | Primitive.TextureEntry tex = part.Shape.Textures; | 11006 | tex = part.Shape.Textures; |
11007 | |||
10989 | if (face == ScriptBaseClass.ALL_SIDES) | 11008 | if (face == ScriptBaseClass.ALL_SIDES) |
10990 | { | 11009 | { |
10991 | for (face = 0; face < GetNumberOfSides(part); face++) | 11010 | for (face = 0; face < nsides; face++) |
10992 | { | 11011 | { |
10993 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | 11012 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); |
10994 | 11013 | ||
@@ -11004,7 +11023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11004 | } | 11023 | } |
11005 | else | 11024 | else |
11006 | { | 11025 | { |
11007 | if (face >= 0 && face < GetNumberOfSides(part)) | 11026 | if (face >= 0 && face < nsides) |
11008 | { | 11027 | { |
11009 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | 11028 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); |
11010 | 11029 | ||
@@ -11025,12 +11044,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11025 | return new LSL_List(); | 11044 | return new LSL_List(); |
11026 | 11045 | ||
11027 | face = (int)rules.GetLSLIntegerItem(idx++); | 11046 | face = (int)rules.GetLSLIntegerItem(idx++); |
11028 | |||
11029 | tex = part.Shape.Textures; | 11047 | tex = part.Shape.Textures; |
11030 | Color4 texcolor; | 11048 | Color4 texcolor; |
11049 | |||
11031 | if (face == ScriptBaseClass.ALL_SIDES) | 11050 | if (face == ScriptBaseClass.ALL_SIDES) |
11032 | { | 11051 | { |
11033 | for (face = 0; face < GetNumberOfSides(part); face++) | 11052 | for (face = 0; face < nsides; face++) |
11034 | { | 11053 | { |
11035 | texcolor = tex.GetFace((uint)face).RGBA; | 11054 | texcolor = tex.GetFace((uint)face).RGBA; |
11036 | res.Add(new LSL_Vector(texcolor.R, | 11055 | res.Add(new LSL_Vector(texcolor.R, |
@@ -11050,16 +11069,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11050 | break; | 11069 | break; |
11051 | 11070 | ||
11052 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 11071 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
11072 | { | ||
11053 | if (remain < 1) | 11073 | if (remain < 1) |
11054 | return new LSL_List(); | 11074 | return new LSL_List(); |
11055 | 11075 | ||
11056 | face = (int)rules.GetLSLIntegerItem(idx++); | 11076 | face = (int)rules.GetLSLIntegerItem(idx++); |
11057 | |||
11058 | tex = part.Shape.Textures; | 11077 | tex = part.Shape.Textures; |
11059 | int shiny; | 11078 | int shiny; |
11060 | if (face == ScriptBaseClass.ALL_SIDES) | 11079 | if (face == ScriptBaseClass.ALL_SIDES) |
11061 | { | 11080 | { |
11062 | for (face = 0; face < GetNumberOfSides(part); face++) | 11081 | for (face = 0; face < nsides; face++) |
11063 | { | 11082 | { |
11064 | Shininess shinyness = tex.GetFace((uint)face).Shiny; | 11083 | Shininess shinyness = tex.GetFace((uint)face).Shiny; |
11065 | if (shinyness == Shininess.High) | 11084 | if (shinyness == Shininess.High) |
@@ -11105,8 +11124,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11105 | res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump)); | 11124 | res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump)); |
11106 | } | 11125 | } |
11107 | break; | 11126 | break; |
11108 | 11127 | } | |
11109 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 11128 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
11129 | { | ||
11110 | if (remain < 1) | 11130 | if (remain < 1) |
11111 | return new LSL_List(); | 11131 | return new LSL_List(); |
11112 | 11132 | ||
@@ -11116,7 +11136,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11116 | int fullbright; | 11136 | int fullbright; |
11117 | if (face == ScriptBaseClass.ALL_SIDES) | 11137 | if (face == ScriptBaseClass.ALL_SIDES) |
11118 | { | 11138 | { |
11119 | for (face = 0; face < GetNumberOfSides(part); face++) | 11139 | for (face = 0; face < nsides; face++) |
11120 | { | 11140 | { |
11121 | if (tex.GetFace((uint)face).Fullbright == true) | 11141 | if (tex.GetFace((uint)face).Fullbright == true) |
11122 | { | 11142 | { |
@@ -11142,7 +11162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11142 | res.Add(new LSL_Integer(fullbright)); | 11162 | res.Add(new LSL_Integer(fullbright)); |
11143 | } | 11163 | } |
11144 | break; | 11164 | break; |
11145 | 11165 | } | |
11146 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: | 11166 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: |
11147 | PrimitiveBaseShape shape = part.Shape; | 11167 | PrimitiveBaseShape shape = part.Shape; |
11148 | 11168 | ||
@@ -11170,7 +11190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11170 | tex = part.Shape.Textures; | 11190 | tex = part.Shape.Textures; |
11171 | if (face == ScriptBaseClass.ALL_SIDES) | 11191 | if (face == ScriptBaseClass.ALL_SIDES) |
11172 | { | 11192 | { |
11173 | for (face = 0; face < GetNumberOfSides(part); face++) | 11193 | for (face = 0; face < nsides; face++) |
11174 | { | 11194 | { |
11175 | if (tex.GetFace((uint)face).TexMapType == MappingType.Planar) | 11195 | if (tex.GetFace((uint)face).TexMapType == MappingType.Planar) |
11176 | { | 11196 | { |
@@ -11220,7 +11240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11220 | float primglow; | 11240 | float primglow; |
11221 | if (face == ScriptBaseClass.ALL_SIDES) | 11241 | if (face == ScriptBaseClass.ALL_SIDES) |
11222 | { | 11242 | { |
11223 | for (face = 0; face < GetNumberOfSides(part); face++) | 11243 | for (face = 0; face < nsides; face++) |
11224 | { | 11244 | { |
11225 | primglow = tex.GetFace((uint)face).Glow; | 11245 | primglow = tex.GetFace((uint)face).Glow; |
11226 | res.Add(new LSL_Float(primglow)); | 11246 | res.Add(new LSL_Float(primglow)); |
@@ -11314,7 +11334,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11314 | tex = part.Shape.Textures; | 11334 | tex = part.Shape.Textures; |
11315 | if (face == ScriptBaseClass.ALL_SIDES) | 11335 | if (face == ScriptBaseClass.ALL_SIDES) |
11316 | { | 11336 | { |
11317 | for (face = 0; face < GetNumberOfSides(part); face++) | 11337 | for (face = 0; face < nsides; face++) |
11318 | { | 11338 | { |
11319 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | 11339 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); |
11320 | getLSLFaceMaterial(ref res, code, part, texface); | 11340 | getLSLFaceMaterial(ref res, code, part, texface); |
@@ -11322,7 +11342,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11322 | } | 11342 | } |
11323 | else | 11343 | else |
11324 | { | 11344 | { |
11325 | if (face >= 0 && face < GetNumberOfSides(part)) | 11345 | if (face >= 0 && face < nsides) |
11326 | { | 11346 | { |
11327 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | 11347 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); |
11328 | getLSLFaceMaterial(ref res, code, part, texface); | 11348 | getLSLFaceMaterial(ref res, code, part, texface); |