diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 43 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 11 |
3 files changed, 54 insertions, 6 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs index 6553192..0afc0ce 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs | |||
@@ -188,9 +188,9 @@ namespace OpenSim.Framework.Data.SQLite | |||
188 | } | 188 | } |
189 | else if (prim.Stopped) | 189 | else if (prim.Stopped) |
190 | { | 190 | { |
191 | MainLog.Instance.Verbose("DATASTORE", | 191 | //MainLog.Instance.Verbose("DATASTORE", |
192 | "Adding stopped obj: " + obj.UUID + " to region: " + regionUUID); | 192 | //"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID); |
193 | addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); | 193 | //addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); |
194 | } | 194 | } |
195 | else | 195 | else |
196 | { | 196 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 9be75da..b7c0596 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -57,7 +57,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
57 | ALLOWED_DROP = 64, | 57 | ALLOWED_DROP = 64, |
58 | OWNER = 128 | 58 | OWNER = 128 |
59 | } | 59 | } |
60 | 60 | [Flags] | |
61 | public enum TextureAnimFlags : byte | ||
62 | { | ||
63 | NONE = 0x00, | ||
64 | ANIM_ON = 0x01, | ||
65 | LOOP = 0x02, | ||
66 | REVERSE = 0x04, | ||
67 | PING_PONG = 0x08, | ||
68 | SMOOTH = 0x10, | ||
69 | ROTATE = 0x20, | ||
70 | SCALE = 0x40 | ||
71 | } | ||
61 | 72 | ||
62 | public partial class SceneObjectPart : IScriptHost | 73 | public partial class SceneObjectPart : IScriptHost |
63 | { | 74 | { |
@@ -1367,9 +1378,37 @@ namespace OpenSim.Region.Environment.Scenes | |||
1367 | UpdateTextureEntry(tex.ToBytes()); | 1378 | UpdateTextureEntry(tex.ToBytes()); |
1368 | } | 1379 | } |
1369 | 1380 | ||
1381 | public byte ConvertScriptUintToByte(uint indata) | ||
1382 | { | ||
1383 | byte outdata = (byte)TextureAnimFlags.NONE; | ||
1384 | if ((indata & 1) != 0) outdata |= (byte)TextureAnimFlags.ANIM_ON; | ||
1385 | if ((indata & 2) != 0) outdata |= (byte)TextureAnimFlags.LOOP; | ||
1386 | if ((indata & 4) != 0) outdata |= (byte)TextureAnimFlags.REVERSE; | ||
1387 | if ((indata & 8) != 0) outdata |= (byte)TextureAnimFlags.PING_PONG; | ||
1388 | if ((indata & 16) != 0) outdata |= (byte)TextureAnimFlags.SMOOTH; | ||
1389 | if ((indata & 32) != 0) outdata |= (byte)TextureAnimFlags.ROTATE; | ||
1390 | if ((indata & 64) != 0) outdata |= (byte)TextureAnimFlags.SCALE; | ||
1391 | return outdata; | ||
1392 | } | ||
1393 | |||
1370 | public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) | 1394 | public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) |
1371 | { | 1395 | { |
1372 | m_TextureAnimation = pTexAnim.GetBytes(); | 1396 | byte[] data = new byte[16]; |
1397 | int pos = 0; | ||
1398 | |||
1399 | // The flags don't like conversion from uint to byte, so we have to do | ||
1400 | // it the crappy way. See the above function :( | ||
1401 | |||
1402 | data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++; | ||
1403 | data[pos] = (byte)pTexAnim.Face; pos++; | ||
1404 | data[pos] = (byte)pTexAnim.SizeX; pos++; | ||
1405 | data[pos] = (byte)pTexAnim.SizeX; pos++; | ||
1406 | |||
1407 | Helpers.FloatToBytes(0).CopyTo(data, pos); | ||
1408 | Helpers.FloatToBytes(0).CopyTo(data, pos + 4); | ||
1409 | Helpers.FloatToBytes(0.5f).CopyTo(data, pos + 8); | ||
1410 | |||
1411 | m_TextureAnimation = data; | ||
1373 | } | 1412 | } |
1374 | 1413 | ||
1375 | #endregion | 1414 | #endregion |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 3f719fb..4054369 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -42,6 +42,7 @@ using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | |||
42 | 42 | ||
43 | namespace OpenSim.Region.ScriptEngine.Common | 43 | namespace OpenSim.Region.ScriptEngine.Common |
44 | { | 44 | { |
45 | |||
45 | /// <summary> | 46 | /// <summary> |
46 | /// Contains all LSL ll-functions. This class will be in Default AppDomain. | 47 | /// Contains all LSL ll-functions. This class will be in Default AppDomain. |
47 | /// </summary> | 48 | /// </summary> |
@@ -2005,16 +2006,24 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2005 | return String.Empty; | 2006 | return String.Empty; |
2006 | } | 2007 | } |
2007 | 2008 | ||
2009 | |||
2010 | |||
2008 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) | 2011 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) |
2009 | { | 2012 | { |
2010 | Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); | 2013 | Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); |
2011 | pTexAnim.Flags = (uint)mode; | 2014 | pTexAnim.Flags =(uint) mode; |
2015 | |||
2016 | //ALL_SIDES | ||
2017 | if (face == -1) | ||
2018 | face = 255; | ||
2019 | |||
2012 | pTexAnim.Face = (uint)face; | 2020 | pTexAnim.Face = (uint)face; |
2013 | pTexAnim.Length = (float)length; | 2021 | pTexAnim.Length = (float)length; |
2014 | pTexAnim.Rate = (float)rate; | 2022 | pTexAnim.Rate = (float)rate; |
2015 | pTexAnim.SizeX = (uint)sizex; | 2023 | pTexAnim.SizeX = (uint)sizex; |
2016 | pTexAnim.SizeY = (uint)sizey; | 2024 | pTexAnim.SizeY = (uint)sizey; |
2017 | pTexAnim.Start = (float)start; | 2025 | pTexAnim.Start = (float)start; |
2026 | |||
2018 | m_host.AddTextureAnimation(pTexAnim); | 2027 | m_host.AddTextureAnimation(pTexAnim); |
2019 | m_host.SendFullUpdateToAllClients(); | 2028 | m_host.SendFullUpdateToAllClients(); |
2020 | } | 2029 | } |