From d71d4f96e32a674c86eb4b20af7c10d382443ce4 Mon Sep 17 00:00:00 2001 From: Marck Date: Sat, 27 Nov 2010 10:59:14 +0100 Subject: Amend GetLinkPrimitiveParams with implementations for PRIM_TEXGEN, PRIM_BUMP_SHINY, PRIM_FULLBRIGHT, and PRIM_GLOW --- .../Shared/Api/Implementation/LSL_Api.cs | 86 +++++++++++++++++++--- 1 file changed, 76 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d06b134..3c5f2d0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7759,24 +7759,59 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_BUMP_SHINY: - // TODO-------------- if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Integer(0)); - res.Add(new LSL_Integer(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + // Convert Shininess to PRIM_SHINY_* + res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); + // PRIM_BUMP_* + res.Add(new LSL_Integer((int)texface.Bump)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + // Convert Shininess to PRIM_SHINY_* + res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); + // PRIM_BUMP_* + res.Add(new LSL_Integer((int)texface.Bump)); + } + } break; case (int)ScriptBaseClass.PRIM_FULLBRIGHT: - // TODO-------------- if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Integer(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); + } + } break; case (int)ScriptBaseClass.PRIM_FLEXIBLE: @@ -7797,14 +7832,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_TEXGEN: - // TODO-------------- - // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Integer(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + MappingType texgen = tex.GetFace((uint)face).TexMapType; + // Convert MappingType to PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR etc. + res.Add(new LSL_Integer((uint)texgen >> 1)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + MappingType texgen = tex.GetFace((uint)face).TexMapType; + res.Add(new LSL_Integer((uint)texgen >> 1)); + } + } break; case (int)ScriptBaseClass.PRIM_POINT_LIGHT: @@ -7823,14 +7873,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_GLOW: - // TODO-------------- if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Float(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Float(texface.Glow)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Float(texface.Glow)); + } + } break; + case (int)ScriptBaseClass.PRIM_TEXT: Color4 textColor = part.GetTextColor(); res.Add(part.Text); -- cgit v1.1