UI added hover styling and code cleanup

This commit is contained in:
Antoine Pilote
2021-07-25 15:08:36 -04:00
parent 93e58db870
commit 4b34782452
26 changed files with 589 additions and 128 deletions

View File

@@ -41,30 +41,30 @@ namespace Nuake
void Engine::Tick()
{
// Dont update if no scene is loaded.
if (!CurrentWindow->GetScene())
return;
float time = (float)glfwGetTime();
Timestep timestep = time - m_LastFrameTime;
m_LastFrameTime = time;
// Play mode update all the entities, Editor does not.
if (Engine::IsPlayMode)
// Dont update if no scene is loaded.
if (CurrentWindow->GetScene())
{
CurrentWindow->Update(timestep);
m_FixedUpdateDifference += timestep;
// Fixed update
if (m_FixedUpdateDifference >= m_FixedUpdateRate)
// Play mode update all the entities, Editor does not.
if (Engine::IsPlayMode)
{
CurrentWindow->FixedUpdate(m_FixedUpdateRate);
m_FixedUpdateDifference = 0.f;
CurrentWindow->Update(timestep);
m_FixedUpdateDifference += timestep;
// Fixed update
if (m_FixedUpdateDifference >= m_FixedUpdateRate)
{
CurrentWindow->FixedUpdate(m_FixedUpdateRate);
m_FixedUpdateDifference = 0.f;
}
}
else
{
GetCurrentScene()->EditorUpdate(timestep);
}
}
else
{
GetCurrentScene()->EditorUpdate(timestep);
}
Input::Update();