diff options
author | Charles Krinke | 2007-12-19 21:48:50 +0000 |
---|---|---|
committer | Charles Krinke | 2007-12-19 21:48:50 +0000 |
commit | 94ec2a508a7c24f6c9c4678f924b8d7b9977a843 (patch) | |
tree | ad949fdd27d5a9e01230bd6b9d99de718be9534e /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler | |
parent | Refactor asset request processing for consistent status information on whethe... (diff) | |
download | opensim-SC-94ec2a508a7c24f6c9c4678f924b8d7b9977a843.zip opensim-SC-94ec2a508a7c24f6c9c4678f924b8d7b9977a843.tar.gz opensim-SC-94ec2a508a7c24f6c9c4678f924b8d7b9977a843.tar.bz2 opensim-SC-94ec2a508a7c24f6c9c4678f924b8d7b9977a843.tar.xz |
Thank you very much, CharlieO for:
Added: llSetLinkAlpha() and finished off llSetLinkColor() by adding the ability to use LINK_SET.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | 118 |
1 files changed, 114 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index bd6eadb..832ccf1 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -1172,9 +1172,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1172 | 1172 | ||
1173 | public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) | 1173 | public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) |
1174 | { | 1174 | { |
1175 | // still needs to be adjusted for compatability with link constants | ||
1176 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); | 1175 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); |
1177 | if (part != null) | 1176 | if (linknumber > -1) |
1178 | { | 1177 | { |
1179 | LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); | 1178 | LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); |
1180 | LLColor texcolor; | 1179 | LLColor texcolor; |
@@ -1211,9 +1210,50 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1211 | } | 1210 | } |
1212 | return; | 1211 | return; |
1213 | } | 1212 | } |
1213 | else if (linknumber == -1) | ||
1214 | { | ||
1215 | int num = m_host.ParentGroup.PrimCount; | ||
1216 | for (int w = 0; w < num; w++) | ||
1217 | { | ||
1218 | linknumber = w; | ||
1219 | part = m_host.ParentGroup.GetLinkNumPart(linknumber); | ||
1220 | LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); | ||
1221 | LLColor texcolor; | ||
1222 | if (face > -1) | ||
1223 | { | ||
1224 | texcolor = tex.CreateFace((uint)face).RGBA; | ||
1225 | texcolor.R = (float)Math.Abs(color.x - 1); | ||
1226 | texcolor.G = (float)Math.Abs(color.y - 1); | ||
1227 | texcolor.B = (float)Math.Abs(color.z - 1); | ||
1228 | tex.FaceTextures[face].RGBA = texcolor; | ||
1229 | part.UpdateTexture(tex); | ||
1230 | } | ||
1231 | else if (face == -1) | ||
1232 | { | ||
1233 | texcolor = tex.DefaultTexture.RGBA; | ||
1234 | texcolor.R = (float)Math.Abs(color.x - 1); | ||
1235 | texcolor.G = (float)Math.Abs(color.y - 1); | ||
1236 | texcolor.B = (float)Math.Abs(color.z - 1); | ||
1237 | tex.DefaultTexture.RGBA = texcolor; | ||
1238 | for (uint i = 0; i < 32; i++) | ||
1239 | { | ||
1240 | if (tex.FaceTextures[i] != null) | ||
1241 | { | ||
1242 | texcolor = tex.FaceTextures[i].RGBA; | ||
1243 | texcolor.R = (float)Math.Abs(color.x - 1); | ||
1244 | texcolor.G = (float)Math.Abs(color.y - 1); | ||
1245 | texcolor.B = (float)Math.Abs(color.z - 1); | ||
1246 | tex.FaceTextures[i].RGBA = texcolor; | ||
1247 | } | ||
1248 | } | ||
1249 | part.UpdateTexture(tex); | ||
1250 | } | ||
1251 | } | ||
1252 | return; | ||
1253 | } | ||
1214 | else | 1254 | else |
1215 | { | 1255 | { |
1216 | throw new Exception("Link does not contain enough prims for the given linknumber setting"); | 1256 | NotImplemented("llSetLinkColor"); |
1217 | } | 1257 | } |
1218 | } | 1258 | } |
1219 | 1259 | ||
@@ -2350,7 +2390,77 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2350 | 2390 | ||
2351 | public void llSetLinkAlpha(int linknumber, double alpha, int face) | 2391 | public void llSetLinkAlpha(int linknumber, double alpha, int face) |
2352 | { | 2392 | { |
2353 | NotImplemented("llSetLinkAlpha"); | 2393 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); |
2394 | if (linknumber > -1) | ||
2395 | { | ||
2396 | LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); | ||
2397 | LLColor texcolor; | ||
2398 | if (face > -1) | ||
2399 | { | ||
2400 | texcolor = tex.CreateFace((uint)face).RGBA; | ||
2401 | texcolor.A = (float)Math.Abs(alpha - 1); | ||
2402 | tex.FaceTextures[face].RGBA = texcolor; | ||
2403 | part.UpdateTexture(tex); | ||
2404 | return; | ||
2405 | } | ||
2406 | else if (face == -1) | ||
2407 | { | ||
2408 | texcolor = tex.DefaultTexture.RGBA; | ||
2409 | texcolor.A = (float)Math.Abs(alpha - 1); | ||
2410 | tex.DefaultTexture.RGBA = texcolor; | ||
2411 | for (uint i = 0; i < 32; i++) | ||
2412 | { | ||
2413 | if (tex.FaceTextures[i] != null) | ||
2414 | { | ||
2415 | texcolor = tex.FaceTextures[i].RGBA; | ||
2416 | texcolor.A = (float)Math.Abs(alpha - 1); | ||
2417 | tex.FaceTextures[i].RGBA = texcolor; | ||
2418 | } | ||
2419 | } | ||
2420 | part.UpdateTexture(tex); | ||
2421 | return; | ||
2422 | } | ||
2423 | return; | ||
2424 | } | ||
2425 | else if (linknumber == -1) | ||
2426 | { | ||
2427 | int num = m_host.ParentGroup.PrimCount; | ||
2428 | for (int w = 0; w < num; w++) | ||
2429 | { | ||
2430 | linknumber = w; | ||
2431 | part = m_host.ParentGroup.GetLinkNumPart(linknumber); | ||
2432 | LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); | ||
2433 | LLColor texcolor; | ||
2434 | if (face > -1) | ||
2435 | { | ||
2436 | texcolor = tex.CreateFace((uint)face).RGBA; | ||
2437 | texcolor.A = (float)Math.Abs(alpha - 1); | ||
2438 | tex.FaceTextures[face].RGBA = texcolor; | ||
2439 | part.UpdateTexture(tex); | ||
2440 | } | ||
2441 | else if (face == -1) | ||
2442 | { | ||
2443 | texcolor = tex.DefaultTexture.RGBA; | ||
2444 | texcolor.A = (float)Math.Abs(alpha - 1); | ||
2445 | tex.DefaultTexture.RGBA = texcolor; | ||
2446 | for (uint i = 0; i < 32; i++) | ||
2447 | { | ||
2448 | if (tex.FaceTextures[i] != null) | ||
2449 | { | ||
2450 | texcolor = tex.FaceTextures[i].RGBA; | ||
2451 | texcolor.A = (float)Math.Abs(alpha - 1); | ||
2452 | tex.FaceTextures[i].RGBA = texcolor; | ||
2453 | } | ||
2454 | } | ||
2455 | part.UpdateTexture(tex); | ||
2456 | } | ||
2457 | } | ||
2458 | return; | ||
2459 | } | ||
2460 | else | ||
2461 | { | ||
2462 | NotImplemented("llSetLinkAlpha"); | ||
2463 | } | ||
2354 | } | 2464 | } |
2355 | 2465 | ||
2356 | public int llGetNumberOfPrims() | 2466 | public int llGetNumberOfPrims() |