Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rms80 committed Jun 26, 2018
1 parent e361444 commit 8b7f9d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion platform/fCurveGameObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void SetVertices(List<Vector3f> vertices)
bVertsValid = false;
}

public void SetVertices(Vector3f[] vertices, bool bCopy = true)
public void SetVertices(Vector3f[] vertices, bool bCopy = true, bool bImmediateUpdate = false)
{
if (bCopy) {
if (Vertices == null || Vertices.Length != vertices.Length)
Expand All @@ -189,6 +189,9 @@ public void SetVertices(Vector3f[] vertices, bool bCopy = true)
} else
Vertices = vertices;
bVertsValid = false;

if (bImmediateUpdate)
PreRender();
}

public override void PreRender()
Expand All @@ -198,6 +201,7 @@ public override void PreRender()
update_curve(Vertices);
bVertsValid = true;
}

}


Expand Down
3 changes: 3 additions & 0 deletions platform/fGameObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ namespace f3
/// Unused GOs are automatically parented to per-instance hidden parent GO, to avoid cluttering scene.
/// When a GO is freed, it is hidden.
/// When a GO is allocated from pool, it is set to have no parent, visible, and transform is cleared.
/// if FreeF is set, this is called when a GO is freed
/// If ReinitializeF is set, this is also called on re-used GOs (*not* called on newly-allocated GOs as
/// you can do that in your FactoryF)
/// </summary>
public class fGameObjectPool<T> where T : fGameObject
{
public Func<T> AllocatorFactoryF;
public Action<T> FreeF;
public Action<T> ReinitializeF;

fGameObject pool_parent;
Expand Down Expand Up @@ -67,6 +69,7 @@ public void FreeAll()
{
foreach (T go in Allocated) {
if (go.IsVisible()) {
FreeF(go);
go.SetVisible(false);
go.SetParent(pool_parent);
}
Expand Down

0 comments on commit 8b7f9d6

Please sign in to comment.