diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-09 04:50:40 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-09 07:37:18 +0200 |
commit | b6dfe86cadaa9e38b4265d69972fb7dff5b73fff (patch) | |
tree | f5dcf90197a7b24a70a742c16c4538ae2c3e6fe3 /src/Render.cpp | |
parent | Refactored Block (diff) | |
download | AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.gz AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.bz2 AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.lz AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.xz AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.zst AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Render.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Render.cpp b/src/Render.cpp index ea3252c..c1f7f2c 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -40,6 +40,7 @@ Render::Render(unsigned int windowWidth, unsigned int windowHeight, fieldVsync = Settings::ReadBool("vsync", false); fieldWireframe = Settings::ReadBool("wireframe", false); fieldFlight = Settings::ReadBool("flight", false); + fieldBrightness = Settings::ReadDouble("brightness", 0.2f); //Apply settings if (fieldSensetivity != sensetivity) @@ -66,6 +67,7 @@ Render::~Render() { Settings::WriteBool("vsync", fieldVsync); Settings::WriteBool("wireframe", fieldWireframe); Settings::WriteBool("flight", fieldFlight); + Settings::WriteDouble("brightness", fieldBrightness); Settings::Save(); ImGui_ImplSdlGL3_Shutdown(); @@ -561,6 +563,8 @@ void Render::RenderGui() { ImGui::SliderFloat("Render distance", &fieldDistance, 1.0f, 16.0f); + ImGui::SliderFloat("Brightness", &fieldBrightness, 0.0f, 1.0f); + ImGui::SliderFloat("Sensetivity", &fieldSensetivity, 0.01f, 1.0f); ImGui::SliderFloat("Target FPS", &fieldTargetFps, 1.0f, 300.0f); @@ -570,7 +574,7 @@ void Render::RenderGui() { ImGui::Checkbox("VSync", &fieldVsync); ImGui::Checkbox("Creative flight", &fieldFlight); - + if (ImGui::Button("Apply settings")) { if (fieldDistance != world->MaxRenderingDistance) { world->MaxRenderingDistance = fieldDistance; @@ -590,6 +594,8 @@ void Render::RenderGui() { } else SDL_GL_SetSwapInterval(0); + PUSH_EVENT("SetMinLightLevel", fieldBrightness); + } ImGui::Separator(); @@ -623,7 +629,7 @@ void Render::InitEvents() { stateString = "Loading terrain..."; world = std::make_unique<RendererWorld>(GlobalState::GetGameState()); world->MaxRenderingDistance = fieldDistance; - PUSH_EVENT("UpdateSectionsRender", 0); + PUSH_EVENT("UpdateSectionsRender", 0); }); listener.RegisterHandler("RemoveLoadingScreen", [this](const Event&) { @@ -632,6 +638,7 @@ void Render::InitEvents() { GlobalState::SetState(State::Playing); glClearColor(0, 0, 0, 1.0f); world->GameStatePtr()->player->isFlying = this->fieldFlight; + PUSH_EVENT("SetMinLightLevel", fieldBrightness); }); listener.RegisterHandler("ConnectionFailed", [this](const Event& eventData) { |