Mantis #2147
Thank you, ralphos, for a patch the adapts llSetColor and friends to a change in the underlying types. Also, thank you for a much cleaner way of casting types out of lists, which I will adopt throughout.0.6.0-stable
parent
8388fe0669
commit
e7abde70a2
|
@ -1001,9 +1001,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (face > -1)
|
if (face > -1)
|
||||||
{
|
{
|
||||||
texcolor = tex.CreateFace((uint)face).RGBA;
|
texcolor = tex.CreateFace((uint)face).RGBA;
|
||||||
texcolor.R = (float)Math.Abs(color.x - 1);
|
texcolor.R = (float)color.x;
|
||||||
texcolor.G = (float)Math.Abs(color.y - 1);
|
texcolor.G = (float)color.y;
|
||||||
texcolor.B = (float)Math.Abs(color.z - 1);
|
texcolor.B = (float)color.z;
|
||||||
tex.FaceTextures[face].RGBA = texcolor;
|
tex.FaceTextures[face].RGBA = texcolor;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTexture(tex);
|
||||||
return;
|
return;
|
||||||
|
@ -1015,15 +1015,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (tex.FaceTextures[i] != null)
|
if (tex.FaceTextures[i] != null)
|
||||||
{
|
{
|
||||||
texcolor = tex.FaceTextures[i].RGBA;
|
texcolor = tex.FaceTextures[i].RGBA;
|
||||||
texcolor.R = (float)Math.Abs(color.x - 1);
|
texcolor.R = (float)color.x;
|
||||||
texcolor.G = (float)Math.Abs(color.y - 1);
|
texcolor.G = (float)color.y;
|
||||||
texcolor.B = (float)Math.Abs(color.z - 1);
|
texcolor.B = (float)color.z;
|
||||||
tex.FaceTextures[i].RGBA = texcolor;
|
tex.FaceTextures[i].RGBA = texcolor;
|
||||||
}
|
}
|
||||||
texcolor = tex.DefaultTexture.RGBA;
|
texcolor = tex.DefaultTexture.RGBA;
|
||||||
texcolor.R = (float)Math.Abs(color.x - 1);
|
texcolor.R = (float)color.x;
|
||||||
texcolor.G = (float)Math.Abs(color.y - 1);
|
texcolor.G = (float)color.y;
|
||||||
texcolor.B = (float)Math.Abs(color.z - 1);
|
texcolor.B = (float)color.z;
|
||||||
tex.DefaultTexture.RGBA = texcolor;
|
tex.DefaultTexture.RGBA = texcolor;
|
||||||
}
|
}
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTexture(tex);
|
||||||
|
@ -5783,11 +5783,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
|
case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
|
||||||
if (remain < 5)
|
if (remain < 5)
|
||||||
return;
|
return;
|
||||||
LSL_Types.LSLInteger light = new LSL_Types.LSLInteger(rules.Data[idx++].ToString());
|
bool light = rules.GetLSLIntegerItem(idx++);
|
||||||
LSL_Types.Vector3 lightcolor = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
LSL_Types.Vector3 lightcolor = rules.GetVector3Item(idx++);
|
||||||
float intensity = (float)Convert.ToDouble(rules.Data[idx++].ToString());
|
float intensity = (float)rules.GetLSLFloatItem(idx++);
|
||||||
float radius = (float)Convert.ToDouble(rules.Data[idx++].ToString());
|
float radius = (float)rules.GetLSLFloatItem(idx++);
|
||||||
float falloff = (float)Convert.ToDouble(rules.Data[idx++].ToString());
|
float falloff = (float)rules.GetLSLFloatItem(idx++);
|
||||||
|
|
||||||
SetPointLight(part, light, lightcolor, intensity, radius, falloff);
|
SetPointLight(part, light, lightcolor, intensity, radius, falloff);
|
||||||
|
|
||||||
|
@ -5795,8 +5795,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
case (int)ScriptBaseClass.PRIM_GLOW:
|
case (int)ScriptBaseClass.PRIM_GLOW:
|
||||||
if (remain < 2)
|
if (remain < 2)
|
||||||
return;
|
return;
|
||||||
|
// TODO: LSL constant ALL_SIDES (value -1) is inserted into LSL_Types.list
|
||||||
|
// as a raw CLI Int32. When / if this is inserted as an
|
||||||
|
// LSL_Types.LSLInteger extract value using LSL_Types.list.GetLSLIntegerItem
|
||||||
|
// face = rules.GetLSLIntegerItem(idx++);
|
||||||
face = Convert.ToInt32(rules.Data[idx++].ToString());
|
face = Convert.ToInt32(rules.Data[idx++].ToString());
|
||||||
float glow = (float)Convert.ToDouble(rules.Data[idx++].ToString());
|
float glow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
|
|
||||||
SetGlow(part, face, glow);
|
SetGlow(part, face, glow);
|
||||||
|
|
||||||
|
@ -5814,14 +5818,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
|
case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
|
||||||
if (remain < 2)
|
if (remain < 2)
|
||||||
return;
|
return;
|
||||||
|
// TODO: LSL constant ALL_SIDES (value -1) is inserted into LSL_Types.list
|
||||||
|
// as a raw CLI Int32. When / if this is inserted as an
|
||||||
|
// LSL_Types.LSLInteger extract value using LSL_Types.list.GetLSLIntegerItem
|
||||||
|
// face = rules.GetLSLIntegerItem(idx++);
|
||||||
face = Convert.ToInt32(rules.Data[idx++].ToString());
|
face = Convert.ToInt32(rules.Data[idx++].ToString());
|
||||||
string bv = rules.Data[idx++].ToString();
|
bool st = rules.GetLSLIntegerItem(idx++);
|
||||||
bool st;
|
|
||||||
if (bv.Equals("1"))
|
|
||||||
st = true;
|
|
||||||
else
|
|
||||||
st = false;
|
|
||||||
|
|
||||||
SetFullBright(part, face , st);
|
SetFullBright(part, face , st);
|
||||||
break;
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_MATERIAL:
|
case (int)ScriptBaseClass.PRIM_MATERIAL:
|
||||||
|
|
|
@ -472,7 +472,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||||
return (LSL_Types.key)m_data[itemIndex];
|
return (LSL_Types.key)m_data[itemIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static list operator +(list a, list b)
|
public static list operator +(list a, list b)
|
||||||
{
|
{
|
||||||
object[] tmp;
|
object[] tmp;
|
||||||
|
@ -488,19 +487,19 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||||
m_data.SetValue(o, Length - 1);
|
m_data.SetValue(o, Length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static list operator +(list a, string s)
|
public static list operator +(list a, LSLString s)
|
||||||
{
|
{
|
||||||
a.ExtendAndAdd(s);
|
a.ExtendAndAdd(s);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static list operator +(list a, int i)
|
public static list operator +(list a, LSLInteger i)
|
||||||
{
|
{
|
||||||
a.ExtendAndAdd(i);
|
a.ExtendAndAdd(i);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static list operator +(list a, double d)
|
public static list operator +(list a, LSLFloat d)
|
||||||
{
|
{
|
||||||
a.ExtendAndAdd(d);
|
a.ExtendAndAdd(d);
|
||||||
return a;
|
return a;
|
||||||
|
|
Loading…
Reference in New Issue