diff options
author | Tom Grimshaw | 2010-05-29 02:10:34 -0700 |
---|---|---|
committer | Tom Grimshaw | 2010-05-29 02:10:34 -0700 |
commit | e3dac1292ef000daadda3e264354d8df0fc77c22 (patch) | |
tree | 932b9872e470b7ac7f20ed185dbba4b7caa17fa4 /OpenSim/Region/ScriptEngine/Shared | |
parent | Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff) | |
download | opensim-SC-e3dac1292ef000daadda3e264354d8df0fc77c22.zip opensim-SC-e3dac1292ef000daadda3e264354d8df0fc77c22.tar.gz opensim-SC-e3dac1292ef000daadda3e264354d8df0fc77c22.tar.bz2 opensim-SC-e3dac1292ef000daadda3e264354d8df0fc77c22.tar.xz |
Implement suspended updates - When an operation is occurring on lots of prims in a single group, don't schedule any updates until the operation has completed. This makes things like llSetAlpha(LINK_SET,0.0,ALL_SIDES); a *lot* faster, more efficient and less buggy, and also makes unlinking a lot better. Linking is still treacherous.. this needs to be analysed.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 132 |
1 files changed, 107 insertions, 25 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 68f6e7b..bb02fa3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1649,9 +1649,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1649 | m_host.AddScriptLPS(1); | 1649 | m_host.AddScriptLPS(1); |
1650 | 1650 | ||
1651 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 1651 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
1652 | 1652 | if (parts.Count > 0) | |
1653 | foreach (SceneObjectPart part in parts) | 1653 | { |
1654 | SetAlpha(part, alpha, face); | 1654 | try |
1655 | { | ||
1656 | parts[0].ParentGroup.areUpdatesSuspended = true; | ||
1657 | foreach (SceneObjectPart part in parts) | ||
1658 | SetAlpha(part, alpha, face); | ||
1659 | } | ||
1660 | finally | ||
1661 | { | ||
1662 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
1663 | } | ||
1664 | } | ||
1655 | } | 1665 | } |
1656 | 1666 | ||
1657 | protected void SetAlpha(SceneObjectPart part, double alpha, int face) | 1667 | protected void SetAlpha(SceneObjectPart part, double alpha, int face) |
@@ -1816,10 +1826,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1816 | m_host.AddScriptLPS(1); | 1826 | m_host.AddScriptLPS(1); |
1817 | 1827 | ||
1818 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 1828 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
1819 | 1829 | if (parts.Count > 0) | |
1820 | foreach (SceneObjectPart part in parts) | 1830 | { |
1821 | SetTexture(part, texture, face); | 1831 | try |
1822 | 1832 | { | |
1833 | parts[0].ParentGroup.areUpdatesSuspended = true; | ||
1834 | foreach (SceneObjectPart part in parts) | ||
1835 | SetTexture(part, texture, face); | ||
1836 | } | ||
1837 | finally | ||
1838 | { | ||
1839 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
1840 | } | ||
1841 | } | ||
1823 | ScriptSleep(200); | 1842 | ScriptSleep(200); |
1824 | } | 1843 | } |
1825 | 1844 | ||
@@ -3661,9 +3680,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3661 | public void llSetLinkColor(int linknumber, LSL_Vector color, int face) | 3680 | public void llSetLinkColor(int linknumber, LSL_Vector color, int face) |
3662 | { | 3681 | { |
3663 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 3682 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
3664 | 3683 | if (parts.Count > 0) | |
3665 | foreach (SceneObjectPart part in parts) | 3684 | { |
3666 | part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); | 3685 | try |
3686 | { | ||
3687 | parts[0].ParentGroup.areUpdatesSuspended = true; | ||
3688 | foreach (SceneObjectPart part in parts) | ||
3689 | part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); | ||
3690 | } | ||
3691 | finally | ||
3692 | { | ||
3693 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
3694 | } | ||
3695 | } | ||
3667 | } | 3696 | } |
3668 | 3697 | ||
3669 | public void llCreateLink(string target, int parent) | 3698 | public void llCreateLink(string target, int parent) |
@@ -3776,10 +3805,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3776 | // Restructuring Multiple Prims. | 3805 | // Restructuring Multiple Prims. |
3777 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); | 3806 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); |
3778 | parts.Remove(parentPrim.RootPart); | 3807 | parts.Remove(parentPrim.RootPart); |
3779 | foreach (SceneObjectPart part in parts) | 3808 | if (parts.Count > 0) |
3780 | { | 3809 | { |
3781 | parentPrim.DelinkFromGroup(part.LocalId, true); | 3810 | try |
3811 | { | ||
3812 | parts[0].ParentGroup.areUpdatesSuspended = true; | ||
3813 | foreach (SceneObjectPart part in parts) | ||
3814 | { | ||
3815 | parentPrim.DelinkFromGroup(part.LocalId, true); | ||
3816 | } | ||
3817 | } | ||
3818 | finally | ||
3819 | { | ||
3820 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
3821 | } | ||
3782 | } | 3822 | } |
3823 | |||
3783 | parentPrim.HasGroupChanged = true; | 3824 | parentPrim.HasGroupChanged = true; |
3784 | parentPrim.ScheduleGroupForFullUpdate(); | 3825 | parentPrim.ScheduleGroupForFullUpdate(); |
3785 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); | 3826 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); |
@@ -3788,11 +3829,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3788 | { | 3829 | { |
3789 | SceneObjectPart newRoot = parts[0]; | 3830 | SceneObjectPart newRoot = parts[0]; |
3790 | parts.Remove(newRoot); | 3831 | parts.Remove(newRoot); |
3791 | foreach (SceneObjectPart part in parts) | 3832 | |
3833 | try | ||
3792 | { | 3834 | { |
3793 | part.UpdateFlag = 0; | 3835 | parts[0].ParentGroup.areUpdatesSuspended = true; |
3794 | newRoot.ParentGroup.LinkToGroup(part.ParentGroup); | 3836 | foreach (SceneObjectPart part in parts) |
3837 | { | ||
3838 | part.UpdateFlag = 0; | ||
3839 | newRoot.ParentGroup.LinkToGroup(part.ParentGroup); | ||
3840 | } | ||
3795 | } | 3841 | } |
3842 | finally | ||
3843 | { | ||
3844 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
3845 | } | ||
3846 | |||
3847 | |||
3796 | newRoot.ParentGroup.HasGroupChanged = true; | 3848 | newRoot.ParentGroup.HasGroupChanged = true; |
3797 | newRoot.ParentGroup.ScheduleGroupForFullUpdate(); | 3849 | newRoot.ParentGroup.ScheduleGroupForFullUpdate(); |
3798 | } | 3850 | } |
@@ -3818,11 +3870,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3818 | 3870 | ||
3819 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); | 3871 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); |
3820 | parts.Remove(parentPrim.RootPart); | 3872 | parts.Remove(parentPrim.RootPart); |
3821 | 3873 | if (parts.Count > 0) | |
3822 | foreach (SceneObjectPart part in parts) | ||
3823 | { | 3874 | { |
3824 | parentPrim.DelinkFromGroup(part.LocalId, true); | 3875 | try |
3825 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); | 3876 | { |
3877 | parts[0].ParentGroup.areUpdatesSuspended = true; | ||
3878 | foreach (SceneObjectPart part in parts) | ||
3879 | { | ||
3880 | parentPrim.DelinkFromGroup(part.LocalId, true); | ||
3881 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); | ||
3882 | } | ||
3883 | } | ||
3884 | finally | ||
3885 | { | ||
3886 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
3887 | } | ||
3826 | } | 3888 | } |
3827 | parentPrim.HasGroupChanged = true; | 3889 | parentPrim.HasGroupChanged = true; |
3828 | parentPrim.ScheduleGroupForFullUpdate(); | 3890 | parentPrim.ScheduleGroupForFullUpdate(); |
@@ -5664,10 +5726,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5664 | m_host.AddScriptLPS(1); | 5726 | m_host.AddScriptLPS(1); |
5665 | 5727 | ||
5666 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 5728 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
5667 | 5729 | if (parts.Count > 0) | |
5668 | foreach (var part in parts) | ||
5669 | { | 5730 | { |
5670 | SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate); | 5731 | try |
5732 | { | ||
5733 | parts[0].ParentGroup.areUpdatesSuspended = true; | ||
5734 | foreach (var part in parts) | ||
5735 | { | ||
5736 | SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate); | ||
5737 | } | ||
5738 | } | ||
5739 | finally | ||
5740 | { | ||
5741 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
5742 | } | ||
5671 | } | 5743 | } |
5672 | } | 5744 | } |
5673 | 5745 | ||
@@ -7068,9 +7140,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7068 | m_host.AddScriptLPS(1); | 7140 | m_host.AddScriptLPS(1); |
7069 | 7141 | ||
7070 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 7142 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
7071 | 7143 | if (parts.Count>0) | |
7072 | foreach (SceneObjectPart part in parts) | 7144 | { |
7073 | SetPrimParams(part, rules); | 7145 | try |
7146 | { | ||
7147 | parts[0].ParentGroup.areUpdatesSuspended = true; | ||
7148 | foreach (SceneObjectPart part in parts) | ||
7149 | SetPrimParams(part, rules); | ||
7150 | } | ||
7151 | finally | ||
7152 | { | ||
7153 | parts[0].ParentGroup.areUpdatesSuspended = false; | ||
7154 | } | ||
7155 | } | ||
7074 | } | 7156 | } |
7075 | 7157 | ||
7076 | public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) | 7158 | public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) |