diff options
author | Charles Krinke | 2008-10-06 14:50:58 +0000 |
---|---|---|
committer | Charles Krinke | 2008-10-06 14:50:58 +0000 |
commit | 68021fa8ff35c482bea6a47d4fcffb7f47676a13 (patch) | |
tree | d7bae236d2cc6748f430c05a30c2e64e7742b825 /OpenSim/Region/ScriptEngine | |
parent | Mantis#2340. Thank you kindly, Sacha Magne for a patch that: (diff) | |
download | opensim-SC-68021fa8ff35c482bea6a47d4fcffb7f47676a13.zip opensim-SC-68021fa8ff35c482bea6a47d4fcffb7f47676a13.tar.gz opensim-SC-68021fa8ff35c482bea6a47d4fcffb7f47676a13.tar.bz2 opensim-SC-68021fa8ff35c482bea6a47d4fcffb7f47676a13.tar.xz |
Mantis#2342. Thank you kindly, Ralphos for a patch that solves:
llSetLinkApha is not fully implemented and has not been updated
to use the recently added GetLinkParts and associated implementation
pattern as per llSetLinkColor and llSetLinkPrimitiveParams.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 88 |
1 files changed, 10 insertions, 78 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fffc331..1031889 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1332,6 +1332,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1332 | SetAlpha(m_host, alpha, face); | 1332 | SetAlpha(m_host, alpha, face); |
1333 | } | 1333 | } |
1334 | 1334 | ||
1335 | public void llSetLinkAlpha(int linknumber, double alpha, int face) | ||
1336 | { | ||
1337 | m_host.AddScriptLPS(1); | ||
1338 | |||
1339 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | ||
1340 | |||
1341 | foreach (SceneObjectPart part in parts) | ||
1342 | SetAlpha(part, alpha, face); | ||
1343 | } | ||
1344 | |||
1335 | private void SetAlpha(SceneObjectPart part, double alpha, int face) | 1345 | private void SetAlpha(SceneObjectPart part, double alpha, int face) |
1336 | { | 1346 | { |
1337 | Primitive.TextureEntry tex = part.Shape.Textures; | 1347 | Primitive.TextureEntry tex = part.Shape.Textures; |
@@ -6239,84 +6249,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6239 | return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); | 6249 | return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); |
6240 | } | 6250 | } |
6241 | 6251 | ||
6242 | public void llSetLinkAlpha(int linknumber, double alpha, int face) | ||
6243 | { | ||
6244 | m_host.AddScriptLPS(1); | ||
6245 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); | ||
6246 | if (linknumber > -1) | ||
6247 | { | ||
6248 | Primitive.TextureEntry tex = part.Shape.Textures; | ||
6249 | Color4 texcolor; | ||
6250 | if (face >= 0 && face < GetNumberOfSides(m_host)) | ||
6251 | { | ||
6252 | texcolor = tex.CreateFace((uint)face).RGBA; | ||
6253 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6254 | tex.FaceTextures[face].RGBA = texcolor; | ||
6255 | part.UpdateTexture(tex); | ||
6256 | return; | ||
6257 | } | ||
6258 | else if (face == ScriptBaseClass.ALL_SIDES) | ||
6259 | { | ||
6260 | texcolor = tex.DefaultTexture.RGBA; | ||
6261 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6262 | tex.DefaultTexture.RGBA = texcolor; | ||
6263 | for (uint i = 0; i < GetNumberOfSides(m_host); i++) | ||
6264 | { | ||
6265 | if (tex.FaceTextures[i] != null) | ||
6266 | { | ||
6267 | texcolor = tex.FaceTextures[i].RGBA; | ||
6268 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6269 | tex.FaceTextures[i].RGBA = texcolor; | ||
6270 | } | ||
6271 | } | ||
6272 | texcolor = tex.DefaultTexture.RGBA; | ||
6273 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6274 | tex.DefaultTexture.RGBA = texcolor; | ||
6275 | part.UpdateTexture(tex); | ||
6276 | return; | ||
6277 | } | ||
6278 | return; | ||
6279 | } | ||
6280 | else if (linknumber == -1) | ||
6281 | { | ||
6282 | int num = m_host.ParentGroup.PrimCount; | ||
6283 | for (int w = 0; w < num; w++) | ||
6284 | { | ||
6285 | linknumber = w; | ||
6286 | part = m_host.ParentGroup.GetLinkNumPart(linknumber); | ||
6287 | Primitive.TextureEntry tex = part.Shape.Textures; | ||
6288 | Color4 texcolor; | ||
6289 | if (face > -1) | ||
6290 | { | ||
6291 | texcolor = tex.CreateFace((uint)face).RGBA; | ||
6292 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6293 | tex.FaceTextures[face].RGBA = texcolor; | ||
6294 | part.UpdateTexture(tex); | ||
6295 | } | ||
6296 | else if (face == -1) | ||
6297 | { | ||
6298 | texcolor = tex.DefaultTexture.RGBA; | ||
6299 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6300 | tex.DefaultTexture.RGBA = texcolor; | ||
6301 | for (uint i = 0; i < 32; i++) | ||
6302 | { | ||
6303 | if (tex.FaceTextures[i] != null) | ||
6304 | { | ||
6305 | texcolor = tex.FaceTextures[i].RGBA; | ||
6306 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6307 | tex.FaceTextures[i].RGBA = texcolor; | ||
6308 | } | ||
6309 | } | ||
6310 | texcolor = tex.DefaultTexture.RGBA; | ||
6311 | texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); | ||
6312 | tex.DefaultTexture.RGBA = texcolor; | ||
6313 | part.UpdateTexture(tex); | ||
6314 | } | ||
6315 | } | ||
6316 | return; | ||
6317 | } | ||
6318 | } | ||
6319 | |||
6320 | public LSL_Integer llGetNumberOfPrims() | 6252 | public LSL_Integer llGetNumberOfPrims() |
6321 | { | 6253 | { |
6322 | m_host.AddScriptLPS(1); | 6254 | m_host.AddScriptLPS(1); |