aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-18 02:01:12 +0100
committerJustin Clark-Casey (justincc)2011-07-18 02:01:12 +0100
commit3f8e571b7887758514645c46b2b26d7c3fc82e45 (patch)
tree446912d24ef58adc3b30e59823f2a342385fcf48 /OpenSim/Region
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-3f8e571b7887758514645c46b2b26d7c3fc82e45.zip
opensim-SC_OLD-3f8e571b7887758514645c46b2b26d7c3fc82e45.tar.gz
opensim-SC_OLD-3f8e571b7887758514645c46b2b26d7c3fc82e45.tar.bz2
opensim-SC_OLD-3f8e571b7887758514645c46b2b26d7c3fc82e45.tar.xz
Use a standard generic system stack for the undo/redo stacks instead of our own homebrew.
system stack also uses an array, so no performance penalty. Also exposes undo count and adds a test assertion for correct undo count after resize
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs2
2 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 253326e..a1200ee 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -287,8 +287,8 @@ namespace OpenSim.Region.Framework.Scenes
287 private string m_sitAnimation = "SIT"; 287 private string m_sitAnimation = "SIT";
288 private string m_text = String.Empty; 288 private string m_text = String.Empty;
289 private string m_touchName = String.Empty; 289 private string m_touchName = String.Empty;
290 private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5); 290 private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5);
291 private readonly UndoStack<UndoState> m_redo = new UndoStack<UndoState>(5); 291 private readonly Stack<UndoState> m_redo = new Stack<UndoState>(5);
292 private UUID _creatorID; 292 private UUID _creatorID;
293 293
294 private bool m_passTouches; 294 private bool m_passTouches;
@@ -3707,6 +3707,18 @@ namespace OpenSim.Region.Framework.Scenes
3707// } 3707// }
3708 } 3708 }
3709 3709
3710 /// <summary>
3711 /// Return number of undos on the stack. Here temporarily pending a refactor.
3712 /// </summary>
3713 public int UndoCount
3714 {
3715 get
3716 {
3717 lock (m_undo)
3718 return m_undo.Count;
3719 }
3720 }
3721
3710 public void Undo() 3722 public void Undo()
3711 { 3723 {
3712// m_log.DebugFormat("[SCENE OBJECT PART]: Handling undo request for {0} {1}", Name, LocalId); 3724// m_log.DebugFormat("[SCENE OBJECT PART]: Handling undo request for {0} {1}", Name, LocalId);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
index 7ec36b8..6dbac3c 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
@@ -62,6 +62,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
62 Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2)); 62 Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2));
63 Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3)); 63 Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3));
64 Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4)); 64 Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4));
65
66 Assert.That(g1Post.RootPart.UndoCount, Is.EqualTo(1));
65 } 67 }
66 68
67 /// <summary> 69 /// <summary>