* Added Full support for llSetTextureAnim. To ckrinke: Let the fountains of Wright Plaza flow!
* Fixed another bug in LibSL. This is the same version, as before just with a bug fix.ThreadPoolClientBranch
parent
785b641272
commit
2d6c21e8fc
|
@ -188,9 +188,9 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
}
|
||||
else if (prim.Stopped)
|
||||
{
|
||||
MainLog.Instance.Verbose("DATASTORE",
|
||||
"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID));
|
||||
//MainLog.Instance.Verbose("DATASTORE",
|
||||
//"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
//addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -57,7 +57,18 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
ALLOWED_DROP = 64,
|
||||
OWNER = 128
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum TextureAnimFlags : byte
|
||||
{
|
||||
NONE = 0x00,
|
||||
ANIM_ON = 0x01,
|
||||
LOOP = 0x02,
|
||||
REVERSE = 0x04,
|
||||
PING_PONG = 0x08,
|
||||
SMOOTH = 0x10,
|
||||
ROTATE = 0x20,
|
||||
SCALE = 0x40
|
||||
}
|
||||
|
||||
public partial class SceneObjectPart : IScriptHost
|
||||
{
|
||||
|
@ -1367,9 +1378,37 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
UpdateTextureEntry(tex.ToBytes());
|
||||
}
|
||||
|
||||
public byte ConvertScriptUintToByte(uint indata)
|
||||
{
|
||||
byte outdata = (byte)TextureAnimFlags.NONE;
|
||||
if ((indata & 1) != 0) outdata |= (byte)TextureAnimFlags.ANIM_ON;
|
||||
if ((indata & 2) != 0) outdata |= (byte)TextureAnimFlags.LOOP;
|
||||
if ((indata & 4) != 0) outdata |= (byte)TextureAnimFlags.REVERSE;
|
||||
if ((indata & 8) != 0) outdata |= (byte)TextureAnimFlags.PING_PONG;
|
||||
if ((indata & 16) != 0) outdata |= (byte)TextureAnimFlags.SMOOTH;
|
||||
if ((indata & 32) != 0) outdata |= (byte)TextureAnimFlags.ROTATE;
|
||||
if ((indata & 64) != 0) outdata |= (byte)TextureAnimFlags.SCALE;
|
||||
return outdata;
|
||||
}
|
||||
|
||||
public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim)
|
||||
{
|
||||
m_TextureAnimation = pTexAnim.GetBytes();
|
||||
byte[] data = new byte[16];
|
||||
int pos = 0;
|
||||
|
||||
// The flags don't like conversion from uint to byte, so we have to do
|
||||
// it the crappy way. See the above function :(
|
||||
|
||||
data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++;
|
||||
data[pos] = (byte)pTexAnim.Face; pos++;
|
||||
data[pos] = (byte)pTexAnim.SizeX; pos++;
|
||||
data[pos] = (byte)pTexAnim.SizeX; pos++;
|
||||
|
||||
Helpers.FloatToBytes(0).CopyTo(data, pos);
|
||||
Helpers.FloatToBytes(0).CopyTo(data, pos + 4);
|
||||
Helpers.FloatToBytes(0.5f).CopyTo(data, pos + 8);
|
||||
|
||||
m_TextureAnimation = data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -42,6 +42,7 @@ using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
|
|||
|
||||
namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Contains all LSL ll-functions. This class will be in Default AppDomain.
|
||||
/// </summary>
|
||||
|
@ -2005,16 +2006,24 @@ namespace OpenSim.Region.ScriptEngine.Common
|
|||
return String.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
|
||||
{
|
||||
Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
|
||||
pTexAnim.Flags = (uint)mode;
|
||||
pTexAnim.Flags =(uint) mode;
|
||||
|
||||
//ALL_SIDES
|
||||
if (face == -1)
|
||||
face = 255;
|
||||
|
||||
pTexAnim.Face = (uint)face;
|
||||
pTexAnim.Length = (float)length;
|
||||
pTexAnim.Rate = (float)rate;
|
||||
pTexAnim.SizeX = (uint)sizex;
|
||||
pTexAnim.SizeY = (uint)sizey;
|
||||
pTexAnim.Start = (float)start;
|
||||
|
||||
m_host.AddTextureAnimation(pTexAnim);
|
||||
m_host.SendFullUpdateToAllClients();
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue