diff options
author | Charles Krinke | 2008-08-16 02:33:26 +0000 |
---|---|---|
committer | Charles Krinke | 2008-08-16 02:33:26 +0000 |
commit | 35f0e6f6f42fd1e90e1f60dfd898405bff95858c (patch) | |
tree | d217fd62b0f98c8fac4f6210912e39dcdd864b5e | |
parent | Remove a project that had no buiness being in there (diff) | |
download | opensim-SC-35f0e6f6f42fd1e90e1f60dfd898405bff95858c.zip opensim-SC-35f0e6f6f42fd1e90e1f60dfd898405bff95858c.tar.gz opensim-SC-35f0e6f6f42fd1e90e1f60dfd898405bff95858c.tar.bz2 opensim-SC-35f0e6f6f42fd1e90e1f60dfd898405bff95858c.tar.xz |
Mantis#1964. Thank you kindly, BlueWall for a patch that:
Parch adds PRIM_BUMP_SHINY handling to llSetPrimitiveParams
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 66 |
1 files 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 | |||
1038 | return; | 1038 | return; |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) | ||
1043 | { | ||
1044 | |||
1045 | Shininess sval = new Shininess(); | ||
1046 | |||
1047 | switch (shiny) | ||
1048 | { | ||
1049 | case 0: | ||
1050 | sval = Shininess.None; | ||
1051 | break; | ||
1052 | case 1: | ||
1053 | sval = Shininess.Low; | ||
1054 | break; | ||
1055 | case 2: | ||
1056 | sval = Shininess.Medium; | ||
1057 | break; | ||
1058 | case 3: | ||
1059 | sval = Shininess.High; | ||
1060 | break; | ||
1061 | default: | ||
1062 | sval = Shininess.None; | ||
1063 | break; | ||
1064 | } | ||
1065 | |||
1066 | LLObject.TextureEntry tex = part.Shape.Textures; | ||
1067 | if (face > -1) | ||
1068 | { | ||
1069 | tex.CreateFace((uint) face); | ||
1070 | tex.FaceTextures[face].Shiny = sval; | ||
1071 | tex.FaceTextures[face].Bump = bump; | ||
1072 | part.UpdateTexture(tex); | ||
1073 | return; | ||
1074 | } | ||
1075 | else if (face == -1) | ||
1076 | { | ||
1077 | for (uint i = 0; i < 32; i++) | ||
1078 | { | ||
1079 | if (tex.FaceTextures[i] != null) | ||
1080 | { | ||
1081 | tex.FaceTextures[i].Shiny = sval; | ||
1082 | tex.FaceTextures[i].Bump = bump;; | ||
1083 | } | ||
1084 | tex.DefaultTexture.Shiny = sval; | ||
1085 | tex.DefaultTexture.Bump = bump; | ||
1086 | } | ||
1087 | part.UpdateTexture(tex); | ||
1088 | return; | ||
1089 | } | ||
1090 | } | ||
1091 | |||
1042 | public double llGetAlpha(int face) | 1092 | public double llGetAlpha(int face) |
1043 | { | 1093 | { |
1044 | m_host.AddScriptLPS(1); | 1094 | m_host.AddScriptLPS(1); |
@@ -5437,8 +5487,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5437 | 5487 | ||
5438 | SetGlow(part, face, glow); | 5488 | SetGlow(part, face, glow); |
5439 | 5489 | ||
5440 | break; | 5490 | break; |
5441 | } | 5491 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
5492 | if (remain < 3) | ||
5493 | return; | ||
5494 | face = Convert.ToInt32(rules.Data[idx++]); | ||
5495 | int shiny = Convert.ToInt32(rules.Data[idx++]); | ||
5496 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); | ||
5497 | |||
5498 | SetShiny(part, face, shiny, bump); | ||
5499 | |||
5500 | break; | ||
5501 | } | ||
5442 | } | 5502 | } |
5443 | } | 5503 | } |
5444 | 5504 | ||