BIG MESS. changed Iclient interface so only one event is used to inform scene about position scale or rotation change by client (others can be added). Its served at SceneGraph that does permition checks, undostore and sends down to SOG. changed values are stored in a class (ObjectChangeData) and what is changed as a enum (ObjectChangeWhat) with bit fields and 'macros' of this for better readability (at top of scenegraph.cs lasy to find better place for now) this can be extended for other things clients changes and need undo/redo. SOG process acording to what is changed. Changed UNDO/redo to use this also (warning is only storing what is changed, previus stored all, this must be checked for side efects. to save all PRS change commented line in scenegraph). Still have excessive calls to ScheduleGroupForTerseUpdate. **** UNTESTED ****

This commit is contained in:
UbitUmarov
2012-03-10 20:32:19 +00:00
parent 0e5e324a2c
commit 908abb1c3d
10 changed files with 543 additions and 139 deletions

View File

@@ -1944,6 +1944,7 @@ namespace OpenSim.Region.Framework.Scenes
PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate;
PhysActor.OnOutOfBounds += PhysicsOutOfBounds;
if (ParentID != 0 && ParentID != LocalId)
{
if (ParentGroup.RootPart.PhysActor != null)
@@ -3656,7 +3657,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.ScheduleGroupForTerseUpdate();
//ParentGroup.ScheduleGroupForFullUpdate();
}
/*
public void StoreUndoState()
{
StoreUndoState(false);
@@ -3697,6 +3698,44 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
*/
public void StoreUndoState(ObjectChangeWhat what)
{
if (!Undoing && !IgnoreUndoUpdate) // just to read better - undo is in progress, or suspended
{
if (ParentGroup != null)
{
lock (m_undo)
{
if (m_undo.Count > 0)
{
// see if we had a change
UndoState last = m_undo.Peek();
if (last != null)
{
if (last.Compare(this, what))
{
return;
}
}
}
if (ParentGroup.GetSceneMaxUndo() > 0)
{
UndoState nUndo = new UndoState(this, what);
m_undo.Push(nUndo);
if (m_redo.Count > 0)
m_redo.Clear();
}
}
}
}
}
/// <summary>
/// Return number of undos on the stack. Here temporarily pending a refactor.
@@ -3725,10 +3764,10 @@ namespace OpenSim.Region.Framework.Scenes
if (goback != null)
{
UndoState nUndo = null;
if (ParentGroup.GetSceneMaxUndo() > 0)
{
nUndo = new UndoState(this, goback.ForGroup);
nUndo = new UndoState(this, goback.data.what);
}
goback.PlayState(this);
@@ -3760,7 +3799,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (ParentGroup.GetSceneMaxUndo() > 0)
{
UndoState nUndo = new UndoState(this, gofwd.ForGroup);
UndoState nUndo = new UndoState(this, gofwd.data.what);
m_undo.Push(nUndo);
}