From 87e2a694e200f5774f71d38041247912b5ccf98d Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 27 Dec 2007 14:00:30 +0000 Subject: * AssetServerBase: _ProcessRequest is now called GetAsset * PrimitiveBaseShape: The textures are now exposed as a 'TextureEntry Textures'; all serialization still using the 'byte[] TextureEntry' for backwards compatibility. * Scene: Re-added AddTree, since the Tree type isn't gone from libsl, merely relocated. --- OpenSim/Region/ClientStack/ClientView.cs | 2 +- .../Environment/Modules/DynamicTextureModule.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 7 ++--- .../Region/Environment/Scenes/SceneObjectPart.cs | 2 +- .../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 33 +++++++++++----------- .../OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | 8 ++++-- .../MonoSqliteDataStore.cs | 6 +++- 7 files changed, 34 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 45806ff..f29d2f9 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -3474,7 +3474,7 @@ namespace OpenSim.Region.ClientStack shape.PathTwist = addPacket.ObjectData.PathTwist; shape.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")); - shape.TextureEntry = ntex.ToBytes(); + shape.Textures = ntex; return shape; } diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs index 2668812..6a0af45 100644 --- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs @@ -182,7 +182,7 @@ namespace OpenSim.Region.Environment.Modules LastAssetID = asset.FullID; SceneObjectPart part = scene.GetSceneObjectPart(PrimID); - part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes(); + part.Shape.Textures = new LLObject.TextureEntry(asset.FullID); part.ScheduleFullUpdate(); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2a25316..0144c4c 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1006,19 +1006,18 @@ namespace OpenSim.Region.Environment.Scenes } } -/* Tree has been removed from libSL public void AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position, - libsecondlife.ObjectManager.Tree treeType, bool newTree) + Tree treeType, bool newTree) { PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); treeShape.PathCurve = 16; treeShape.PathEnd = 49900; - treeShape.PCode = newTree ? (byte)libsecondlife.ObjectManager.PCode.NewTree : (byte)libsecondlife.ObjectManager.PCode.Tree; + treeShape.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree; treeShape.Scale = scale; treeShape.State = (byte)treeType; AddNewPrim(LLUUID.Random(), position, rotation, treeShape); } -*/ + public void RemovePrim(uint localID, LLUUID avatar_deleter) { m_innerScene.RemovePrim(localID, avatar_deleter); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index e8ff007..29a163b 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1323,7 +1323,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdateTextureEntry(byte[] textureEntry) { - m_shape.TextureEntry = textureEntry; + m_shape.Textures = new LLObject.TextureEntry( textureEntry, 0, textureEntry.Length ); ScheduleFullUpdate(); } 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 63b4773..bc47241 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 @@ -459,7 +459,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public void llSetColor(LSL_Types.Vector3 color, int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; LLColor texcolor; if (face > -1) { @@ -498,7 +498,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public double llGetAlpha(int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); @@ -512,7 +512,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public void llSetAlpha(double alpha, int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; LLColor texcolor; if (face > -1) { @@ -545,7 +545,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public LSL_Types.Vector3 llGetColor(int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; LLColor texcolor; LSL_Types.Vector3 rgb; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color @@ -570,7 +570,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public void llSetTexture(string texture, int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; + if (face > -1) { LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); @@ -598,7 +599,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public void llScaleTexture(double u, double v, int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; if (face > -1) { LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); @@ -629,7 +630,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public void llOffsetTexture(double u, double v, int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; if (face > -1) { LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); @@ -660,7 +661,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public void llRotateTexture(double rotation, int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; if (face > -1) { LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); @@ -688,7 +689,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public string llGetTexture(int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; if (face == -1) { face = 0; @@ -1172,7 +1173,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); if (linknumber > -1) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = part.Shape.Textures; LLColor texcolor; if (face > -1) { @@ -1219,7 +1220,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { linknumber = w; part = m_host.ParentGroup.GetLinkNumPart(linknumber); - LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = part.Shape.Textures; LLColor texcolor; if (face > -1) { @@ -1467,7 +1468,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public LSL_Types.Vector3 llGetTextureOffset(int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; LSL_Types.Vector3 offset; if (face == -1) { @@ -1481,7 +1482,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public LSL_Types.Vector3 llGetTextureScale(int side) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; LSL_Types.Vector3 scale; if (side == -1) { @@ -1495,7 +1496,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public double llGetTextureRot(int face) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = m_host.Shape.Textures; if (face == -1) { face = 0; @@ -2413,7 +2414,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); if (linknumber > -1) { - LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = part.Shape.Textures; LLColor texcolor; if (face > -1) { @@ -2452,7 +2453,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { linknumber = w; part = m_host.ParentGroup.GetLinkNumPart(linknumber); - LLObject.TextureEntry tex = new LLObject.TextureEntry(part.Shape.TextureEntry, 0, part.Shape.TextureEntry.Length); + LLObject.TextureEntry tex = part.Shape.Textures; LLColor texcolor; if (face > -1) { diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs index 91edf5e..0a48126 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs @@ -634,9 +634,13 @@ namespace OpenSim.DataStore.MSSQL s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]); s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); + // text TODO: this isn't right] = but I'm not sure the right - // way to specify this as a blob atm - s.TextureEntry = (byte[])row["Texture"]; + // way to specify this as a blob atm + byte[] textureEntry = (byte[])row["Texture"]; + s.TextureEntry = textureEntry; + + s.ExtraParams = (byte[])row["ExtraParams"]; // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); // string texture = encoding.GetString((Byte[])row["Texture"]); diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 5bf4551..9118082 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -1014,7 +1014,11 @@ namespace OpenSim.DataStore.MonoSqlite s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); // text TODO: this isn't right] = but I'm not sure the right // way to specify this as a blob atm - s.TextureEntry = (byte[]) row["Texture"]; + + byte[] textureEntry = (byte[])row["Texture"]; + s.TextureEntry = textureEntry; + + s.ExtraParams = (byte[]) row["ExtraParams"]; // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); // string texture = encoding.GetString((Byte[])row["Texture"]); -- cgit v1.1