Made buffer fixed array

This commit is contained in:
Simon Lübeß
2021-09-15 18:43:45 +02:00
parent 0b8be33d68
commit b8626f3c27
2 changed files with 8 additions and 21 deletions
@@ -14,7 +14,7 @@ namespace GlitchyEngine.Editor
private Editor _editor; private Editor _editor;
/// Buffer for the entity search string. /// Buffer for the entity search string.
private char8[] _entitySearchChars = new char8[64] ~ delete _; private char8[64] _entitySearchChars;
private bool _show = true; private bool _show = true;
@@ -33,6 +33,9 @@ namespace GlitchyEngine.Editor
public void Show() public void Show()
{ {
if(!_show)
return;
if(!ImGui.Begin("Entity Hierarchy", null, .MenuBar)) if(!ImGui.Begin("Entity Hierarchy", null, .MenuBar))
{ {
ImGui.End(); ImGui.End();
@@ -112,7 +115,7 @@ namespace GlitchyEngine.Editor
ImGui.Text("Search:"); ImGui.Text("Search:");
ImGui.InputText(String.Empty, _entitySearchChars.Ptr, (.)_entitySearchChars.Count); ImGui.InputText(String.Empty, &_entitySearchChars, (.)_entitySearchChars.Count);
ImGui.EndMenuBar(); ImGui.EndMenuBar();
} }
@@ -130,7 +133,7 @@ namespace GlitchyEngine.Editor
} }
else else
{ {
name = scope:: $"Entity {((uint64)tree.Value.[Friend]Index)}"; name = scope:: $"Entity {(tree.Value.[Friend]Index)}";
} }
ImGui.TreeNodeFlags flags = .OpenOnArrow; ImGui.TreeNodeFlags flags = .OpenOnArrow;
@@ -231,7 +234,7 @@ namespace GlitchyEngine.Editor
private void ShowEntityHierarchy() private void ShowEntityHierarchy()
{ {
StringView searchString = StringView(_entitySearchChars.Ptr); StringView searchString = StringView(&_entitySearchChars);
if(searchString.Length == 0) if(searchString.Length == 0)
{ {
+1 -17
View File
@@ -545,23 +545,7 @@ namespace Sandbox
private bool OnImGuiRender(ImGuiRenderEvent e) private bool OnImGuiRender(ImGuiRenderEvent e)
{ {
_editor.Update(); _editor.Update();
ImGui.Begin("Animation");
/* /*
if(AnimationPlayer != null)
{
ImGui.DragFloat("Timestamp", &AnimationPlayer.TimeStamp, 0.01f, -AnimationPlayer.CurrentClip.Duration, AnimationPlayer.CurrentClip.Duration);
while(AnimationPlayer.TimeStamp < 0)
{
AnimationPlayer.TimeStamp += AnimationPlayer.CurrentClip.Duration;
}
ImGui.Checkbox("Play", &playAnimation);
}
*/
ImGui.End();
ImGui.Begin("Test"); ImGui.Begin("Test");
var v = ImGui.ColorEdit3("Square Color", ref _squareColor0); var v = ImGui.ColorEdit3("Square Color", ref _squareColor0);
@@ -573,7 +557,7 @@ namespace Sandbox
} }
ImGui.End(); ImGui.End();
*/
return false; return false;
} }