Fix improper use of RMVPool.
This commit is contained in:
@@ -186,7 +186,6 @@ namespace Cryville.Crtr.Event {
|
|||||||
child.Value.CopyTo(ct, dest.Children[child.Key]);
|
child.Value.CopyTo(ct, dest.Children[child.Key]);
|
||||||
ValidateChildren();
|
ValidateChildren();
|
||||||
|
|
||||||
RMVPool.ReturnAll();
|
|
||||||
dest.PlayingMotions.Clear();
|
dest.PlayingMotions.Clear();
|
||||||
foreach (var m in PlayingMotions) dest.PlayingMotions.Add(m.Key, m.Value);
|
foreach (var m in PlayingMotions) dest.PlayingMotions.Add(m.Key, m.Value);
|
||||||
}
|
}
|
||||||
@@ -324,11 +323,14 @@ namespace Cryville.Crtr.Event {
|
|||||||
if (ev.Unstamped is Chart.Motion) {
|
if (ev.Unstamped is Chart.Motion) {
|
||||||
var tev = (Chart.Motion)ev.Unstamped;
|
var tev = (Chart.Motion)ev.Unstamped;
|
||||||
var mv = RMVPool.Rent(tev.Name);
|
var mv = RMVPool.Rent(tev.Name);
|
||||||
|
mv.CloneTypeFlag = CloneType;
|
||||||
GetMotionValue(tev.Name).CopyTo(mv);
|
GetMotionValue(tev.Name).CopyTo(mv);
|
||||||
PlayingMotions.Add(ev, mv);
|
PlayingMotions.Add(ev, mv);
|
||||||
Callback(ev, callback);
|
Callback(ev, callback);
|
||||||
if (!ev.Unstamped.IsLong)
|
if (!ev.Unstamped.IsLong) {
|
||||||
PlayingMotions.Remove(ev);
|
PlayingMotions.Remove(ev);
|
||||||
|
RMVPool.Return(mv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (ev.Unstamped is EventContainer) {
|
else if (ev.Unstamped is EventContainer) {
|
||||||
var cev = (EventContainer)ev.Unstamped;
|
var cev = (EventContainer)ev.Unstamped;
|
||||||
@@ -348,6 +350,8 @@ namespace Cryville.Crtr.Event {
|
|||||||
var nev = tev.Original;
|
var nev = tev.Original;
|
||||||
if (nev is Chart.Motion) {
|
if (nev is Chart.Motion) {
|
||||||
Callback(ev, callback);
|
Callback(ev, callback);
|
||||||
|
var mv = PlayingMotions[ev.Origin];
|
||||||
|
if (mv.CloneTypeFlag == CloneType) RMVPool.Return(mv);
|
||||||
PlayingMotions.Remove(ev.Origin);
|
PlayingMotions.Remove(ev.Origin);
|
||||||
}
|
}
|
||||||
else if (nev is EventContainer) {
|
else if (nev is EventContainer) {
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ namespace Cryville.Crtr {
|
|||||||
public class RealtimeMotionValue {
|
public class RealtimeMotionValue {
|
||||||
public Vector AbsoluteValue;
|
public Vector AbsoluteValue;
|
||||||
List<MotionNode> RelativeNodes;
|
List<MotionNode> RelativeNodes;
|
||||||
|
internal byte CloneTypeFlag;
|
||||||
|
|
||||||
public RealtimeMotionValue Init(Vector init) {
|
public RealtimeMotionValue Init(Vector init) {
|
||||||
RelativeNodes = new List<MotionNode> {
|
RelativeNodes = new List<MotionNode> {
|
||||||
|
|||||||
Reference in New Issue
Block a user