This commit is contained in:
2024-07-24 00:51:03 -07:00
parent c1b83d07fd
commit 148c10eb08
2 changed files with 16 additions and 26 deletions

View File

@@ -339,7 +339,7 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
lwe::Entity ent("Main");
ent.SetScale({0.25f, 0.25f, 0.25f});
ent.SetPos({0.0f, -1.0f, 5.0f});
ent.SetPos({0.0f, -1.0f, 10.0f});
//ent->SetRot({-90.0f, 180.0f, 0.0f});
//ent->AddComponent(new lwe::Networked(false, false, lwe::EndpointOwner::SERVICE));
@@ -385,7 +385,7 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
AddEntity((lwe::Entity&&)ent);
lwe::Entity sun("Sun");
sun.SetPos({-5.0f, 0.0f, 5.0f});
sun.SetPos({-5.0f, 0.0f, 10.0f});
lwe::AmbientPointLight* sunLight = new lwe::AmbientPointLight("Light");
sunLight->SetDiffuse({1.0f, 0.77254901960784313725490196078431f, 0.56078431372549019607843137254902f});
@@ -394,7 +394,7 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
AddEntity((lwe::Entity&&)sun);
lwe::Entity emergency("Emergency");
emergency.SetPos({5.0f, 0.0f, 5.0f});
emergency.SetPos({5.0f, 0.0f, 10.0f});
lwe::PointLight* pl = new lwe::PointLight("Light");
pl->SetColor({1.0f, 0.0f, 0.0f});
@@ -470,6 +470,17 @@ void TestLevel::OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float
if (!gl)
return;
lwe::GuiSystem* guiSys = (lwe::GuiSystem*)GetSystem("GuiSystem");
if (!guiSys)
return;
lwe::CollectionGui* stats = (lwe::CollectionGui*)guiSys->GetGui("Stats");
if (!stats)
return;
lwe::LabelGui* fps = (lwe::LabelGui*)stats->GetChild("FPS");
fps->SetText("FPS: " + ehs::Str_8::FromNum(gl->GetTPS()));
const ehs::InputHandler* ih = win->GetInputHandler();
if (!ih)
return;
@@ -525,17 +536,6 @@ void TestLevel::OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float
cooldown -= delta;
}
lwe::GuiSystem* guiSys = (lwe::GuiSystem*)GetSystem("GuiSystem");
if (!guiSys)
return;
lwe::CollectionGui* stats = (lwe::CollectionGui*)guiSys->GetGui("Stats");
if (!stats)
return;
lwe::LabelGui* fps = (lwe::LabelGui*)stats->GetChild("FPS");
fps->SetText("FPS: " + ehs::Str_8::FromNum(gl->GetTPS()));
lwe::AudioSource* source = (lwe::AudioSource*)ent->GetComponent("AudioSource3D", "Song");
if (!source)
return;