aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-03-13 13:08:32 +0100
committerMelanie2012-03-13 13:08:32 +0100
commitebcd4910a21726c830796cfe14c0792007b766b7 (patch)
treebc62802ae47fad6f9cffd0ccb2e4e61af56befe8
parentRestore duplication of the SL bug where linking phantom to solid lets the (diff)
downloadopensim-SC_OLD-ebcd4910a21726c830796cfe14c0792007b766b7.zip
opensim-SC_OLD-ebcd4910a21726c830796cfe14c0792007b766b7.tar.gz
opensim-SC_OLD-ebcd4910a21726c830796cfe14c0792007b766b7.tar.bz2
opensim-SC_OLD-ebcd4910a21726c830796cfe14c0792007b766b7.tar.xz
Refactor, move OjectChangeData into it's own file and rename
ObjectChnageWhat what into ObjectChangeType change. What is no name for a variable or type!
-rw-r--r--OpenSim/Framework/ObjectChangeData.cs80
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs32
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs115
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs43
6 files changed, 133 insertions, 165 deletions
diff --git a/OpenSim/Framework/ObjectChangeData.cs b/OpenSim/Framework/ObjectChangeData.cs
new file mode 100644
index 0000000..8d56291
--- /dev/null
+++ b/OpenSim/Framework/ObjectChangeData.cs
@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29
30namespace OpenSim.Framework
31{
32 public enum ObjectChangeType : uint
33 {
34 // bits definitions
35 Position = 0x01,
36 Rotation = 0x02,
37 Scale = 0x04,
38 Group = 0x08,
39 UniformScale = 0x10,
40
41 // macros from above
42 // single prim
43 primP = 0x01,
44 primR = 0x02,
45 primPR = 0x03,
46 primS = 0x04,
47 primPS = 0x05,
48 primRS = 0x06,
49 primPSR = 0x07,
50
51 primUS = 0x14,
52 primPUS = 0x15,
53 primRUS = 0x16,
54 primPUSR = 0x17,
55
56 // group
57 groupP = 0x09,
58 groupR = 0x0A,
59 groupPR = 0x0B,
60 groupS = 0x0C,
61 groupPS = 0x0D,
62 groupRS = 0x0E,
63 groupPSR = 0x0F,
64
65 groupUS = 0x1C,
66 groupPUS = 0x1D,
67 groupRUS = 0x1E,
68 groupPUSR = 0x1F,
69
70 PRSmask = 0x07
71 }
72
73 public struct ObjectChangeData
74 {
75 public Quaternion rotation;
76 public Vector3 position;
77 public Vector3 scale;
78 public ObjectChangeType change;
79 }
80}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 4c43c10..18af623 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11504,14 +11504,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11504 case 1: //change position sp 11504 case 1: //change position sp
11505 udata.position = new Vector3(block.Data, 0); 11505 udata.position = new Vector3(block.Data, 0);
11506 11506
11507 udata.what = ObjectChangeWhat.primP; 11507 udata.change = ObjectChangeType.primP;
11508 updatehandler(localId, udata, this); 11508 updatehandler(localId, udata, this);
11509 break; 11509 break;
11510 11510
11511 case 2: // rotation sp 11511 case 2: // rotation sp
11512 udata.rotation = new Quaternion(block.Data, 0, true); 11512 udata.rotation = new Quaternion(block.Data, 0, true);
11513 11513
11514 udata.what = ObjectChangeWhat.primR; 11514 udata.change = ObjectChangeType.primR;
11515 updatehandler(localId, udata, this); 11515 updatehandler(localId, udata, this);
11516 break; 11516 break;
11517 11517
@@ -11519,13 +11519,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11519 udata.position = new Vector3(block.Data, 0); 11519 udata.position = new Vector3(block.Data, 0);
11520 udata.rotation = new Quaternion(block.Data, 12, true); 11520 udata.rotation = new Quaternion(block.Data, 12, true);
11521 11521
11522 udata.what = ObjectChangeWhat.primPR; 11522 udata.change = ObjectChangeType.primPR;
11523 updatehandler(localId, udata, this); 11523 updatehandler(localId, udata, this);
11524 break; 11524 break;
11525 11525
11526 case 4: // scale sp 11526 case 4: // scale sp
11527 udata.scale = new Vector3(block.Data, 0); 11527 udata.scale = new Vector3(block.Data, 0);
11528 udata.what = ObjectChangeWhat.primS; 11528 udata.change = ObjectChangeType.primS;
11529 11529
11530 updatehandler(localId, udata, this); 11530 updatehandler(localId, udata, this);
11531 break; 11531 break;
@@ -11533,7 +11533,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11533 case 0x14: // uniform scale sp 11533 case 0x14: // uniform scale sp
11534 udata.scale = new Vector3(block.Data, 0); 11534 udata.scale = new Vector3(block.Data, 0);
11535 11535
11536 udata.what = ObjectChangeWhat.primUS; 11536 udata.change = ObjectChangeType.primUS;
11537 updatehandler(localId, udata, this); 11537 updatehandler(localId, udata, this);
11538 break; 11538 break;
11539 11539
@@ -11541,7 +11541,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11541 udata.position = new Vector3(block.Data, 0); 11541 udata.position = new Vector3(block.Data, 0);
11542 udata.scale = new Vector3(block.Data, 12); 11542 udata.scale = new Vector3(block.Data, 12);
11543 11543
11544 udata.what = ObjectChangeWhat.primPS; 11544 udata.change = ObjectChangeType.primPS;
11545 updatehandler(localId, udata, this); 11545 updatehandler(localId, udata, this);
11546 break; 11546 break;
11547 11547
@@ -11549,7 +11549,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11549 udata.position = new Vector3(block.Data, 0); 11549 udata.position = new Vector3(block.Data, 0);
11550 udata.scale = new Vector3(block.Data, 12); 11550 udata.scale = new Vector3(block.Data, 12);
11551 11551
11552 udata.what = ObjectChangeWhat.primPUS; 11552 udata.change = ObjectChangeType.primPUS;
11553 updatehandler(localId, udata, this); 11553 updatehandler(localId, udata, this);
11554 break; 11554 break;
11555 11555
@@ -11557,14 +11557,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11557 case 9: //( 8 + 1 )group position 11557 case 9: //( 8 + 1 )group position
11558 udata.position = new Vector3(block.Data, 0); 11558 udata.position = new Vector3(block.Data, 0);
11559 11559
11560 udata.what = ObjectChangeWhat.groupP; 11560 udata.change = ObjectChangeType.groupP;
11561 updatehandler(localId, udata, this); 11561 updatehandler(localId, udata, this);
11562 break; 11562 break;
11563 11563
11564 case 0x0A: // (8 + 2) group rotation 11564 case 0x0A: // (8 + 2) group rotation
11565 udata.rotation = new Quaternion(block.Data, 0, true); 11565 udata.rotation = new Quaternion(block.Data, 0, true);
11566 11566
11567 udata.what = ObjectChangeWhat.groupR; 11567 udata.change = ObjectChangeType.groupR;
11568 updatehandler(localId, udata, this); 11568 updatehandler(localId, udata, this);
11569 break; 11569 break;
11570 11570
@@ -11572,7 +11572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11572 udata.position = new Vector3(block.Data, 0); 11572 udata.position = new Vector3(block.Data, 0);
11573 udata.rotation = new Quaternion(block.Data, 12, true); 11573 udata.rotation = new Quaternion(block.Data, 12, true);
11574 11574
11575 udata.what = ObjectChangeWhat.groupPR; 11575 udata.change = ObjectChangeType.groupPR;
11576 updatehandler(localId, udata, this); 11576 updatehandler(localId, udata, this);
11577 break; 11577 break;
11578 11578
@@ -11583,8 +11583,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11583 11583
11584 udata.scale = new Vector3(block.Data, 0); 11584 udata.scale = new Vector3(block.Data, 0);
11585 11585
11586 // udata.what = ObjectChangeWhat.groupS; 11586 // udata.change = ObjectChangeType.groupS;
11587 udata.what = ObjectChangeWhat.primS; // to conform to current SL 11587 udata.change = ObjectChangeType.primS; // to conform to current SL
11588 updatehandler(localId, udata, this); 11588 updatehandler(localId, udata, this);
11589 11589
11590 break; 11590 break;
@@ -11595,15 +11595,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11595 udata.position = new Vector3(block.Data, 0); 11595 udata.position = new Vector3(block.Data, 0);
11596 udata.scale = new Vector3(block.Data, 12); 11596 udata.scale = new Vector3(block.Data, 12);
11597 11597
11598 // udata.what = ObjectChangeWhat.groupPS; 11598 // udata.change = ObjectChangeType.groupPS;
11599 udata.what = ObjectChangeWhat.primPS; // to conform to current SL 11599 udata.change = ObjectChangeType.primPS; // to conform to current SL
11600 updatehandler(localId, udata, this); 11600 updatehandler(localId, udata, this);
11601 break; 11601 break;
11602 11602
11603 case 0x1C: // (0x10 + 8 + 4 ) group scale UNIFORM 11603 case 0x1C: // (0x10 + 8 + 4 ) group scale UNIFORM
11604 udata.scale = new Vector3(block.Data, 0); 11604 udata.scale = new Vector3(block.Data, 0);
11605 11605
11606 udata.what = ObjectChangeWhat.groupUS; 11606 udata.change = ObjectChangeType.groupUS;
11607 updatehandler(localId, udata, this); 11607 updatehandler(localId, udata, this);
11608 break; 11608 break;
11609 11609
@@ -11611,7 +11611,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11611 udata.position = new Vector3(block.Data, 0); 11611 udata.position = new Vector3(block.Data, 0);
11612 udata.scale = new Vector3(block.Data, 12); 11612 udata.scale = new Vector3(block.Data, 12);
11613 11613
11614 udata.what = ObjectChangeWhat.groupPUS; 11614 udata.change = ObjectChangeType.groupPUS;
11615 updatehandler(localId, udata, this); 11615 updatehandler(localId, udata, this);
11616 break; 11616 break;
11617 11617
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 5e770ba..e6e3ad0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -47,57 +47,6 @@ namespace OpenSim.Region.Framework.Scenes
47 47
48 public delegate void ChangedBackupDelegate(SceneObjectGroup sog); 48 public delegate void ChangedBackupDelegate(SceneObjectGroup sog);
49 49
50
51 public enum ObjectChangeWhat : uint
52 {
53 // bits definitions
54 Position = 0x01,
55 Rotation = 0x02,
56 Scale = 0x04,
57 Group = 0x08,
58 UniformScale = 0x10,
59
60 // macros from above
61 // single prim
62 primP = 0x01,
63 primR = 0x02,
64 primPR = 0x03,
65 primS = 0x04,
66 primPS = 0x05,
67 primRS = 0x06,
68 primPSR = 0x07,
69
70 primUS = 0x14,
71 primPUS = 0x15,
72 primRUS = 0x16,
73 primPUSR = 0x17,
74
75 // group
76 groupP = 0x09,
77 groupR = 0x0A,
78 groupPR = 0x0B,
79 groupS = 0x0C,
80 groupPS = 0x0D,
81 groupRS = 0x0E,
82 groupPSR = 0x0F,
83
84 groupUS = 0x1C,
85 groupPUS = 0x1D,
86 groupRUS = 0x1E,
87 groupPUSR = 0x1F,
88
89 PRSmask = 0x07
90 }
91
92 public struct ObjectChangeData
93 {
94 public Quaternion rotation;
95 public Vector3 position;
96 public Vector3 scale;
97 public ObjectChangeWhat what;
98 }
99
100
101 /// <summary> 50 /// <summary>
102 /// This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components 51 /// This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components
103 /// should be migrated out over time. 52 /// should be migrated out over time.
@@ -1352,75 +1301,13 @@ namespace OpenSim.Region.Framework.Scenes
1352 { 1301 {
1353 if (m_parentScene.Permissions.CanEditObject(grp.UUID, remoteClient.AgentId)) 1302 if (m_parentScene.Permissions.CanEditObject(grp.UUID, remoteClient.AgentId))
1354 { 1303 {
1355// part.StoreUndoState(data.what | ObjectChangeWhat.PRSmask); // for now save all to keep previus behavour ??? 1304 part.StoreUndoState(data.change); // lets test only saving what we changed
1356 part.StoreUndoState(data.what); // lets test only saving what we changed
1357 grp.doChangeObject(part, (ObjectChangeData)data); 1305 grp.doChangeObject(part, (ObjectChangeData)data);
1358 } 1306 }
1359 } 1307 }
1360 } 1308 }
1361 } 1309 }
1362 1310
1363/* moved to SOG
1364 protected internal void doChangeObject(SceneObjectPart part, ObjectChangeData data)
1365 {
1366 if (part != null && part.ParentGroup != null)
1367 {
1368 ObjectChangeWhat what = data.what;
1369 bool togroup = ((what & ObjectChangeWhat.Group) != 0);
1370// bool uniform = ((what & ObjectChangeWhat.UniformScale) != 0); not in use
1371
1372 SceneObjectGroup group = part.ParentGroup;
1373 PhysicsActor pha = group.RootPart.PhysActor;
1374
1375 if (togroup)
1376 {
1377 // related to group
1378 if ((what & ObjectChangeWhat.Position) != 0)
1379 group.AbsolutePosition = data.position;
1380 if ((what & ObjectChangeWhat.Rotation) != 0)
1381 group.RootPart.UpdateRotation(data.rotation);
1382 if ((what & ObjectChangeWhat.Scale) != 0)
1383 {
1384 if (pha != null)
1385 pha.Building = true;
1386 group.GroupResize(data.scale);
1387 if (pha != null)
1388 pha.Building = false;
1389 }
1390 }
1391 else
1392 {
1393 // related to single prim in a link-set ( ie group)
1394 if (pha != null)
1395 pha.Building = true;
1396
1397 // must deal with root part specially for position and rotation
1398 // so parts offset positions or rotations are fixed
1399
1400 if (part == group.RootPart)
1401 {
1402 if ((what & ObjectChangeWhat.Position) != 0)
1403 group.UpdateRootPosition(data.position);
1404 if ((what & ObjectChangeWhat.Rotation) != 0)
1405 group.UpdateRootRotation(data.rotation);
1406 }
1407 else
1408 {
1409 if ((what & ObjectChangeWhat.Position) != 0)
1410 part.OffsetPosition = data.position;
1411 if ((what & ObjectChangeWhat.Rotation) != 0)
1412 part.UpdateRotation(data.rotation);
1413 }
1414
1415 if ((what & ObjectChangeWhat.Scale) != 0)
1416 part.Resize(data.scale);
1417
1418 if (pha != null)
1419 pha.Building = false;
1420 }
1421 }
1422 }
1423*/
1424 /// <summary> 1311 /// <summary>
1425 /// Update the scale of an individual prim. 1312 /// Update the scale of an individual prim.
1426 /// </summary> 1313 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e5cfed0..b2502e0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3521,9 +3521,9 @@ namespace OpenSim.Region.Framework.Scenes
3521 3521
3522 if (part != null && part.ParentGroup != null) 3522 if (part != null && part.ParentGroup != null)
3523 { 3523 {
3524 ObjectChangeWhat what = data.what; 3524 ObjectChangeType change = data.change;
3525 bool togroup = ((what & ObjectChangeWhat.Group) != 0); 3525 bool togroup = ((change & ObjectChangeType.Group) != 0);
3526 // bool uniform = ((what & ObjectChangeWhat.UniformScale) != 0); not in use 3526 // bool uniform = ((what & ObjectChangeType.UniformScale) != 0); not in use
3527 3527
3528 SceneObjectGroup group = part.ParentGroup; 3528 SceneObjectGroup group = part.ParentGroup;
3529 PhysicsActor pha = group.RootPart.PhysActor; 3529 PhysicsActor pha = group.RootPart.PhysActor;
@@ -3533,17 +3533,17 @@ namespace OpenSim.Region.Framework.Scenes
3533 if (togroup) 3533 if (togroup)
3534 { 3534 {
3535 // related to group 3535 // related to group
3536 if ((what & ObjectChangeWhat.Position) != 0) 3536 if ((change & ObjectChangeType.Position) != 0)
3537 { 3537 {
3538 group.AbsolutePosition = data.position; 3538 group.AbsolutePosition = data.position;
3539 updateType = updatetype.groupterse; 3539 updateType = updatetype.groupterse;
3540 } 3540 }
3541 if ((what & ObjectChangeWhat.Rotation) != 0) 3541 if ((change & ObjectChangeType.Rotation) != 0)
3542 { 3542 {
3543 group.RootPart.UpdateRotation(data.rotation); 3543 group.RootPart.UpdateRotation(data.rotation);
3544 updateType = updatetype.none; 3544 updateType = updatetype.none;
3545 } 3545 }
3546 if ((what & ObjectChangeWhat.Scale) != 0) 3546 if ((change & ObjectChangeType.Scale) != 0)
3547 { 3547 {
3548 if (pha != null) 3548 if (pha != null)
3549 pha.Building = true; 3549 pha.Building = true;
@@ -3566,26 +3566,26 @@ namespace OpenSim.Region.Framework.Scenes
3566 3566
3567 if (part == group.RootPart) 3567 if (part == group.RootPart)
3568 { 3568 {
3569 if ((what & ObjectChangeWhat.Position) != 0) 3569 if ((change & ObjectChangeType.Position) != 0)
3570 group.UpdateRootPosition(data.position); 3570 group.UpdateRootPosition(data.position);
3571 if ((what & ObjectChangeWhat.Rotation) != 0) 3571 if ((change & ObjectChangeType.Rotation) != 0)
3572 group.UpdateRootRotation(data.rotation); 3572 group.UpdateRootRotation(data.rotation);
3573 if ((what & ObjectChangeWhat.Scale) != 0) 3573 if ((change & ObjectChangeType.Scale) != 0)
3574 part.Resize(data.scale); 3574 part.Resize(data.scale);
3575 } 3575 }
3576 else 3576 else
3577 { 3577 {
3578 if ((what & ObjectChangeWhat.Position) != 0) 3578 if ((change & ObjectChangeType.Position) != 0)
3579 { 3579 {
3580 part.OffsetPosition = data.position; 3580 part.OffsetPosition = data.position;
3581 updateType = updatetype.partterse; 3581 updateType = updatetype.partterse;
3582 } 3582 }
3583 if ((what & ObjectChangeWhat.Rotation) != 0) 3583 if ((change & ObjectChangeType.Rotation) != 0)
3584 { 3584 {
3585 part.UpdateRotation(data.rotation); 3585 part.UpdateRotation(data.rotation);
3586 updateType = updatetype.none; 3586 updateType = updatetype.none;
3587 } 3587 }
3588 if ((what & ObjectChangeWhat.Scale) != 0) 3588 if ((change & ObjectChangeType.Scale) != 0)
3589 { 3589 {
3590 part.Resize(data.scale); 3590 part.Resize(data.scale);
3591 updateType = updatetype.none; 3591 updateType = updatetype.none;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 94e4560..f647544 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3644,7 +3644,7 @@ namespace OpenSim.Region.Framework.Scenes
3644 //ParentGroup.ScheduleGroupForFullUpdate(); 3644 //ParentGroup.ScheduleGroupForFullUpdate();
3645 } 3645 }
3646 3646
3647 public void StoreUndoState(ObjectChangeWhat what) 3647 public void StoreUndoState(ObjectChangeType change)
3648 { 3648 {
3649 if (m_UndoRedo == null) 3649 if (m_UndoRedo == null)
3650 m_UndoRedo = new UndoRedoState(5); 3650 m_UndoRedo = new UndoRedoState(5);
@@ -3653,7 +3653,7 @@ namespace OpenSim.Region.Framework.Scenes
3653 { 3653 {
3654 if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended 3654 if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended
3655 { 3655 {
3656 m_UndoRedo.StoreUndo(this, what); 3656 m_UndoRedo.StoreUndo(this, change);
3657 } 3657 }
3658 } 3658 }
3659 } 3659 }
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs
index fd90714..7bbf1bd 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -30,6 +30,7 @@ using System.Reflection;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using log4net; 31using log4net;
32using OpenMetaverse; 32using OpenMetaverse;
33using OpenSim.Framework;
33using OpenSim.Region.Framework.Interfaces; 34using OpenSim.Region.Framework.Interfaces;
34 35
35namespace OpenSim.Region.Framework.Scenes 36namespace OpenSim.Region.Framework.Scenes
@@ -44,30 +45,30 @@ namespace OpenSim.Region.Framework.Scenes
44 /// Constructor. 45 /// Constructor.
45 /// </summary> 46 /// </summary>
46 /// <param name="part"></param> 47 /// <param name="part"></param>
47 /// <param name="what">bit field with what is changed</param> 48 /// <param name="change">bit field with what is changed</param>
48 /// 49 ///
49 public UndoState(SceneObjectPart part, ObjectChangeWhat what) 50 public UndoState(SceneObjectPart part, ObjectChangeType change)
50 { 51 {
51 data = new ObjectChangeData(); 52 data = new ObjectChangeData();
52 data.what = what; 53 data.change = change;
53 creationtime = DateTime.UtcNow; 54 creationtime = DateTime.UtcNow;
54 55
55 if (part.ParentGroup.RootPart == part) 56 if (part.ParentGroup.RootPart == part)
56 { 57 {
57 if ((what & ObjectChangeWhat.Position) != 0) 58 if ((change & ObjectChangeType.Position) != 0)
58 data.position = part.ParentGroup.AbsolutePosition; 59 data.position = part.ParentGroup.AbsolutePosition;
59 if ((what & ObjectChangeWhat.Rotation) != 0) 60 if ((change & ObjectChangeType.Rotation) != 0)
60 data.rotation = part.RotationOffset; 61 data.rotation = part.RotationOffset;
61 if ((what & ObjectChangeWhat.Scale) != 0) 62 if ((change & ObjectChangeType.Scale) != 0)
62 data.scale = part.Shape.Scale; 63 data.scale = part.Shape.Scale;
63 } 64 }
64 else 65 else
65 { 66 {
66 if ((what & ObjectChangeWhat.Position) != 0) 67 if ((change & ObjectChangeType.Position) != 0)
67 data.position = part.OffsetPosition; 68 data.position = part.OffsetPosition;
68 if ((what & ObjectChangeWhat.Rotation) != 0) 69 if ((change & ObjectChangeType.Rotation) != 0)
69 data.rotation = part.RotationOffset; 70 data.rotation = part.RotationOffset;
70 if ((what & ObjectChangeWhat.Scale) != 0) 71 if ((change & ObjectChangeType.Scale) != 0)
71 data.scale = part.Shape.Scale; 72 data.scale = part.Shape.Scale;
72 } 73 }
73 } 74 }
@@ -97,27 +98,27 @@ namespace OpenSim.Region.Framework.Scenes
97 /// <param name="part"></param> 98 /// <param name="part"></param>
98 /// <returns>true what fiels and related data are equal, False otherwise.</returns> 99 /// <returns>true what fiels and related data are equal, False otherwise.</returns>
99 /// 100 ///
100 public bool Compare(SceneObjectPart part, ObjectChangeWhat what) 101 public bool Compare(SceneObjectPart part, ObjectChangeType change)
101 { 102 {
102 if (data.what != what) // if diferent targets, then they are diferent 103 if (data.change != change) // if diferent targets, then they are diferent
103 return false; 104 return false;
104 105
105 if (part != null) 106 if (part != null)
106 { 107 {
107 if (part.ParentID == 0) 108 if (part.ParentID == 0)
108 { 109 {
109 if ((what & ObjectChangeWhat.Position) != 0 && data.position != part.ParentGroup.AbsolutePosition) 110 if ((change & ObjectChangeType.Position) != 0 && data.position != part.ParentGroup.AbsolutePosition)
110 return false; 111 return false;
111 } 112 }
112 else 113 else
113 { 114 {
114 if ((what & ObjectChangeWhat.Position) != 0 && data.position != part.OffsetPosition) 115 if ((change & ObjectChangeType.Position) != 0 && data.position != part.OffsetPosition)
115 return false; 116 return false;
116 } 117 }
117 118
118 if ((what & ObjectChangeWhat.Rotation) != 0 && data.rotation != part.RotationOffset) 119 if ((change & ObjectChangeType.Rotation) != 0 && data.rotation != part.RotationOffset)
119 return false; 120 return false;
120 if ((what & ObjectChangeWhat.Rotation) != 0 && data.scale == part.Shape.Scale) 121 if ((change & ObjectChangeType.Rotation) != 0 && data.scale == part.Shape.Scale)
121 return false; 122 return false;
122 return true; 123 return true;
123 124
@@ -196,9 +197,9 @@ namespace OpenSim.Region.Framework.Scenes
196 /// adds a new state undo to part or its group, with changes indicated by what bits 197 /// adds a new state undo to part or its group, with changes indicated by what bits
197 /// </summary> 198 /// </summary>
198 /// <param name="part"></param> 199 /// <param name="part"></param>
199 /// <param name="what">bit field with what is changed</param> 200 /// <param name="change">bit field with what is changed</param>
200 201
201 public void StoreUndo(SceneObjectPart part, ObjectChangeWhat what) 202 public void StoreUndo(SceneObjectPart part, ObjectChangeType change)
202 { 203 {
203 lock (m_undo) 204 lock (m_undo)
204 { 205 {
@@ -220,7 +221,7 @@ namespace OpenSim.Region.Framework.Scenes
220 // see if we actually have a change 221 // see if we actually have a change
221 if (last != null) 222 if (last != null)
222 { 223 {
223 if (last.Compare(part, what)) 224 if (last.Compare(part, change))
224 return; 225 return;
225 } 226 }
226 } 227 }
@@ -230,7 +231,7 @@ namespace OpenSim.Region.Framework.Scenes
230 while (m_undo.Count >= size) 231 while (m_undo.Count >= size)
231 m_undo.RemoveLast(); 232 m_undo.RemoveLast();
232 233
233 UndoState nUndo = new UndoState(part, what); 234 UndoState nUndo = new UndoState(part, change);
234 m_undo.AddFirst(nUndo); 235 m_undo.AddFirst(nUndo);
235 } 236 }
236 } 237 }
@@ -273,7 +274,7 @@ namespace OpenSim.Region.Framework.Scenes
273 while (m_redo.Count >= size) 274 while (m_redo.Count >= size)
274 m_redo.RemoveLast(); 275 m_redo.RemoveLast();
275 276
276 nUndo = new UndoState(part, goback.data.what); // new value in part should it be full goback copy? 277 nUndo = new UndoState(part, goback.data.change); // new value in part should it be full goback copy?
277 m_redo.AddFirst(nUndo); 278 m_redo.AddFirst(nUndo);
278 279
279 goback.PlayState(part); 280 goback.PlayState(part);
@@ -320,7 +321,7 @@ namespace OpenSim.Region.Framework.Scenes
320 while (m_undo.Count >= size) 321 while (m_undo.Count >= size)
321 m_undo.RemoveLast(); 322 m_undo.RemoveLast();
322 323
323 nUndo = new UndoState(part, gofwd.data.what); // new value in part should it be full gofwd copy? 324 nUndo = new UndoState(part, gofwd.data.change); // new value in part should it be full gofwd copy?
324 m_undo.AddFirst(nUndo); 325 m_undo.AddFirst(nUndo);
325 326
326 gofwd.PlayState(part); 327 gofwd.PlayState(part);