From e9ea911563362c4766d34cd948a2915beac06124 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Fri, 17 Aug 2012 16:53:36 +0100 Subject: adding a clip method to handle Vector3 objects to enable a minor amount of refactoring --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a7852ec..b7b5e8e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4019,9 +4019,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetText(string text, LSL_Vector color, double alpha) { m_host.AddScriptLPS(1); - Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f), - Util.Clip((float)color.y, 0.0f, 1.0f), - Util.Clip((float)color.z, 0.0f, 1.0f)); + Vector3 av3 = Util.Clip(new Vector3((float)color.x, (float)color.y, + (float)color.z), 0.0f, 1.0f); m_host.SetText(text.Length > 254 ? text.Remove(254) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); //m_host.ParentGroup.HasGroupChanged = true; //m_host.ParentGroup.ScheduleGroupForFullUpdate(); @@ -7635,9 +7634,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string primText = rules.GetLSLStringItem(idx++); LSL_Vector primTextColor = rules.GetVector3Item(idx++); LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++); - Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f), - Util.Clip((float)primTextColor.y, 0.0f, 1.0f), - Util.Clip((float)primTextColor.z, 0.0f, 1.0f)); + Vector3 av3 = Util.Clip(new Vector3((float)primTextColor.x, + (float)primTextColor.y, + (float)primTextColor.z), 0.0f, 1.0f); part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f)); break; -- cgit v1.1