From 35f0e6f6f42fd1e90e1f60dfd898405bff95858c Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 16 Aug 2008 02:33:26 +0000 Subject: Mantis#1964. Thank you kindly, BlueWall for a patch that: Parch adds PRIM_BUMP_SHINY handling to llSetPrimitiveParams --- .../Shared/Api/Implementation/LSL_Api.cs | 66 +++++++++++++++++++++- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5ab6c4d..9a3fc5c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1038,7 +1038,57 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - + + public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) + { + + Shininess sval = new Shininess(); + + switch (shiny) + { + case 0: + sval = Shininess.None; + break; + case 1: + sval = Shininess.Low; + break; + case 2: + sval = Shininess.Medium; + break; + case 3: + sval = Shininess.High; + break; + default: + sval = Shininess.None; + break; + } + + LLObject.TextureEntry tex = part.Shape.Textures; + if (face > -1) + { + tex.CreateFace((uint) face); + tex.FaceTextures[face].Shiny = sval; + tex.FaceTextures[face].Bump = bump; + part.UpdateTexture(tex); + return; + } + else if (face == -1) + { + for (uint i = 0; i < 32; i++) + { + if (tex.FaceTextures[i] != null) + { + tex.FaceTextures[i].Shiny = sval; + tex.FaceTextures[i].Bump = bump;; + } + tex.DefaultTexture.Shiny = sval; + tex.DefaultTexture.Bump = bump; + } + part.UpdateTexture(tex); + return; + } + } + public double llGetAlpha(int face) { m_host.AddScriptLPS(1); @@ -5437,8 +5487,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetGlow(part, face, glow); - break; - } + break; + case (int)ScriptBaseClass.PRIM_BUMP_SHINY: + if (remain < 3) + return; + face = Convert.ToInt32(rules.Data[idx++]); + int shiny = Convert.ToInt32(rules.Data[idx++]); + Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); + + SetShiny(part, face, shiny, bump); + + break; + } } } -- cgit v1.1