From 5cd6f235ce858bd88820784375ef51d27cb039a1 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 22 Dec 2007 22:49:37 +0000 Subject: [PATCH] Thank you, Alondria for: Reverts the LSL Texture/Color functions back to the original code, allowing them to function again --- CONTRIBUTORS.txt | 2 ++ .../Environment/Scenes/SceneObjectPart.cs | 4 +-- .../Server_API/LSL_BuiltIn_Commands.cs | 35 +++++++++++++++++-- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 5457f71103..d4b1a8e48d 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -21,7 +21,9 @@ OpenSim Developers Patches +* Alondria * BigFootAg +* CharlieO * Danx0r * Dalien * Darok diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index f3be4bd95e..5398de0f09 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1255,12 +1255,12 @@ namespace OpenSim.Region.Environment.Scenes tex.FaceTextures[i].RGBA = tmpcolor; } } - tmpcolor = tex.FaceTextures[0].RGBA; + tmpcolor = tex.DefaultTexture.RGBA; tmpcolor.A = tmpcolor.A * 255; tmpcolor.R = tmpcolor.R * 255; tmpcolor.G = tmpcolor.G * 255; tmpcolor.B = tmpcolor.B * 255; - tex.FaceTextures[0].RGBA = tmpcolor; + tex.DefaultTexture.RGBA = tmpcolor; UpdateTextureEntry(tex.ToBytes()); } 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 1cb307f1a5..a0cd43a3ad 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 @@ -481,6 +481,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler texcolor.B = (float)Math.Abs(color.z - 1); tex.FaceTextures[i].RGBA = texcolor; } + texcolor = tex.DefaultTexture.RGBA; + texcolor.R = (float)Math.Abs(color.x - 1); + texcolor.G = (float)Math.Abs(color.y - 1); + texcolor.B = (float)Math.Abs(color.z - 1); + tex.DefaultTexture.RGBA = texcolor; } m_host.UpdateTexture(tex); return; @@ -494,7 +499,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { - return (double)((tex.FaceTextures[0].RGBA.A * 255) / 255); + return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); } if (face > -1) { @@ -526,6 +531,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].RGBA = texcolor; } } + texcolor = tex.DefaultTexture.RGBA; + texcolor.A = (float)Math.Abs(alpha - 1); + tex.DefaultTexture.RGBA = texcolor; m_host.UpdateTexture(tex); return; } @@ -540,7 +548,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler LSL_Types.Vector3 rgb; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { - texcolor = tex.FaceTextures[0].RGBA; + texcolor = tex.DefaultTexture.RGBA; rgb.x = (255 - (texcolor.R * 255)) / 255; rgb.y = (255 - (texcolor.G * 255)) / 255; rgb.z = (255 - (texcolor.B * 255)) / 255; @@ -578,6 +586,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].TextureID = new LLUUID(texture); } } + tex.DefaultTexture.TextureID = new LLUUID(texture); m_host.UpdateTexture(tex); return; } @@ -605,9 +614,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { tex.FaceTextures[i].RepeatU = (float)u; tex.FaceTextures[i].RepeatV = (float)v; - } } + tex.DefaultTexture.RepeatU = (float)u; + tex.DefaultTexture.RepeatV = (float)v; m_host.UpdateTexture(tex); return; } @@ -637,6 +647,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].OffsetV = (float)v; } } + tex.DefaultTexture.OffsetU = (float)u; + tex.DefaultTexture.OffsetV = (float)v; m_host.UpdateTexture(tex); return; } @@ -664,6 +676,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].Rotation = (float)rotation; } } + tex.DefaultTexture.Rotation = (float)rotation; m_host.UpdateTexture(tex); return; } @@ -1191,6 +1204,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].RGBA = texcolor; } } + texcolor = tex.DefaultTexture.RGBA; + texcolor.R = (float)Math.Abs(color.x - 1); + texcolor.G = (float)Math.Abs(color.y - 1); + texcolor.B = (float)Math.Abs(color.z - 1); + tex.DefaultTexture.RGBA = texcolor; part.UpdateTexture(tex); return; } @@ -1232,6 +1250,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].RGBA = texcolor; } } + texcolor = tex.DefaultTexture.RGBA; + texcolor.R = (float)Math.Abs(color.x - 1); + texcolor.G = (float)Math.Abs(color.y - 1); + texcolor.B = (float)Math.Abs(color.z - 1); + tex.DefaultTexture.RGBA = texcolor; part.UpdateTexture(tex); } } @@ -2403,6 +2426,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].RGBA = texcolor; } } + texcolor = tex.DefaultTexture.RGBA; + texcolor.A = (float)Math.Abs(alpha - 1); + tex.DefaultTexture.RGBA = texcolor; part.UpdateTexture(tex); return; } @@ -2438,6 +2464,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].RGBA = texcolor; } } + texcolor = tex.DefaultTexture.RGBA; + texcolor.A = (float)Math.Abs(alpha - 1); + tex.DefaultTexture.RGBA = texcolor; part.UpdateTexture(tex); } }