Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorton06 committed Aug 8, 2024
1 parent 6edb163 commit 5f4ca6e
Show file tree
Hide file tree
Showing 845 changed files with 8,313 additions and 591,314 deletions.
2 changes: 1 addition & 1 deletion Editor/Source/ConsolePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ namespace Lumos
ImGui::TextUnformatted(m_Message.c_str());

bool clicked = false;
if(ImGui::IsItemClicked())
if(ImGui::IsItemClicked() && ImGui::IsItemHovered())
clicked = true;

if(ImGui::BeginPopupContextItem(m_Message.c_str()))
Expand Down
20 changes: 12 additions & 8 deletions Editor/Source/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ namespace Lumos

if(ImGui::BeginMenu("Scenes"))
{
auto scenes = Application::Get().GetSceneManager()->GetSceneNames();
ArenaTemp scratch = ScratchBegin(0,0);
auto scenes = Application::Get().GetSceneManager()->GetSceneNames(scratch.arena);

for(size_t i = 0; i < scenes.Size(); i++)
{
Expand All @@ -760,7 +761,7 @@ namespace Lumos
Application::Get().GetSceneManager()->SwitchScene((const char*)name.str);
}
}

ScratchEnd(scratch);
ImGui::EndMenu();
}

Expand Down Expand Up @@ -1156,17 +1157,20 @@ namespace Lumos

if(ImGui::Button("OK", ImVec2(120, 0)))
{
std::string sceneName = newSceneName;
String8 sceneName = Str8StdS(newSceneName);
ArenaTemp scratch = ScratchBegin(0,0);
int sameNameCount = 0;
auto sceneNames = m_SceneManager->GetSceneNames();

while(FileSystem::FileExists("//Assets/Scenes/" + sceneName + ".lsn") || m_SceneManager->ContainsScene(sceneName.c_str()))

String8 Path = PushStr8F(scratch.arena, "//Assets/Scenes/%s.lsn", (char*)sceneName.str);
while(FileSystem::FileExists((const char*)Path.str) || m_SceneManager->ContainsScene((const char*)sceneName.str))
{
sameNameCount++;
// sceneName = fmt::format(newSceneName + "{0}", sameNameCount);
sceneName = PushStr8F(scratch.arena, "%s%i", (char*)newSceneName.c_str(), sameNameCount);
Path = PushStr8F(scratch.arena, "//Assets/Scenes/%s.lsn", (char*)sceneName.str);
}
auto scene = new Scene(sceneName);
auto scene = new Scene(std::string((const char*)sceneName.str));

ScratchEnd(scratch);
if(defaultSetup)
{
auto light = scene->GetEntityManager()->Create("Light");
Expand Down
1 change: 1 addition & 0 deletions Editor/Source/EditorSettingsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <Lumos/Graphics/RHI/Renderer.h>
#include <Lumos/Graphics/RHI/Texture.h>
#include <Lumos/Graphics/RHI/GraphicsContext.h>
#include <Lumos/Graphics/Camera/Camera.h>

namespace Lumos
{
Expand Down
2 changes: 1 addition & 1 deletion Editor/Source/HierarchyPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Lumos
{
m_Name = ICON_MDI_FILE_TREE " Hierarchy###hierarchy";
m_SimpleName = "Hierarchy";
m_StringArena = ArenaAlloc(Kilobytes(32));
m_StringArena = ArenaAlloc(Kilobytes(256));

m_HadRecentDroppedEntity = {};
m_DoubleClicked = {};
Expand Down
Loading

0 comments on commit 5f4ca6e

Please sign in to comment.