From 027750e98ff40b87d774dc6ad4700969b3714087 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 24 Mar 2019 00:35:30 +0000 Subject: compact the trivial te case, a more complete one may be needed even beening heavy --- .../ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 10 +++++++++- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 92f5a2c..16178e6 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1012,7 +1012,15 @@ namespace OpenSim.Region.ClientStack.Linden textureEntry.FaceTextures[face] = f; } - pbs.TextureEntry = textureEntry.GetBytes(); + + if(face_list.Count > 0) + { + int last = face_list.Count - 1; + // we do need a better te compacting code + textureEntry.DefaultTexture = textureEntry.FaceTextures[last]; + textureEntry.FaceTextures[last] = null; + pbs.TextureEntry = textureEntry.GetBytes(last); + } Vector3 position = inner_instance_list["position"].AsVector3(); Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ebb8eda..5e2204e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3883,15 +3883,15 @@ namespace OpenSim.Region.Framework.Scenes { if (Shape.SculptEntry && !ignoreSculpt) return PrimType.SCULPT; - - if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) + ProfileShape ps = (ProfileShape)(Shape.ProfileCurve & 0x07); + if (ps == ProfileShape.Square) { if (Shape.PathCurve == (byte)Extrusion.Straight) return PrimType.BOX; else if (Shape.PathCurve == (byte)Extrusion.Curve1) return PrimType.TUBE; } - else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Circle) + else if (ps == ProfileShape.Circle) { if (Shape.PathCurve == (byte)Extrusion.Straight || Shape.PathCurve == (byte)Extrusion.Flexible) return PrimType.CYLINDER; @@ -3899,12 +3899,12 @@ namespace OpenSim.Region.Framework.Scenes else if (Shape.PathCurve == (byte)Extrusion.Curve1) return PrimType.TORUS; } - else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle) + else if (ps == ProfileShape.HalfCircle) { if (Shape.PathCurve == (byte)Extrusion.Curve1 || Shape.PathCurve == (byte)Extrusion.Curve2) return PrimType.SPHERE; } - else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle) + else if (ps == ProfileShape.EquilateralTriangle) { if (Shape.PathCurve == (byte)Extrusion.Straight || Shape.PathCurve == (byte)Extrusion.Flexible) return PrimType.PRISM; @@ -5124,7 +5124,13 @@ namespace OpenSim.Region.Framework.Scenes if (changeFlags == 0) return; - m_shape.TextureEntry = newTex.GetBytes(9); + // we do need better compacter do just the trivial case + if(nsides == 1 && newTex.FaceTextures[0] != null) + { + newTex.DefaultTexture = newTex.GetFace(0); + newTex.FaceTextures[0] = null; + } + m_shape.TextureEntry = newTex.GetBytes(nsides); TriggerScriptChangedEvent(changeFlags); ParentGroup.HasGroupChanged = true; ScheduleUpdate(PrimUpdateFlags.Textures); -- cgit v1.1