diff options
author | LaG1924 <lag1924@gmail.com> | 2021-11-21 15:49:04 +0100 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-11-21 15:49:04 +0100 |
commit | 3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665 (patch) | |
tree | 4fa3363892c0cf7ad7483b87f1b951a8c192a7be /src | |
parent | Moved face lighting to lighting pass (diff) | |
download | AltCraft-3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665.tar AltCraft-3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665.tar.gz AltCraft-3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665.tar.bz2 AltCraft-3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665.tar.lz AltCraft-3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665.tar.xz AltCraft-3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665.tar.zst AltCraft-3f14653e536c6c4b4bb9e4d0a6b2ec0dfeadc665.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Render.cpp | 16 | ||||
-rw-r--r-- | src/Render.hpp | 1 | ||||
-rw-r--r-- | src/RenderConfigs.cpp | 1 | ||||
-rw-r--r-- | src/RenderConfigs.hpp | 8 |
4 files changed, 26 insertions, 0 deletions
diff --git a/src/Render.cpp b/src/Render.cpp index 48114b0..148ec27 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -335,6 +335,22 @@ void Render::HandleEvents() { break; } + case SDL_SCANCODE_F9: { + if (sdlKeyMods & KMOD_CTRL) { + renderBuff = 0; + } else if (sdlKeyMods & KMOD_SHIFT) { + renderBuff--; + if (renderBuff < 0) + renderBuff = 0; + } else { + renderBuff++; + if (renderBuff > gbuffer->GetMaxRenderBuffers()) + renderBuff = 0; + } + gbuffer->SetRenderBuff(renderBuff); + break; + } + default: break; } diff --git a/src/Render.hpp b/src/Render.hpp index 379ca66..8bdcd63 100644 --- a/src/Render.hpp +++ b/src/Render.hpp @@ -48,6 +48,7 @@ class Render { Rml::Context* rmlContext; unsigned short sdlKeyMods = 0; bool hideRml = false; + size_t renderBuff = 0; void SetMouseCapture(bool IsCaptured); diff --git a/src/RenderConfigs.cpp b/src/RenderConfigs.cpp index 86418c2..2867bc6 100644 --- a/src/RenderConfigs.cpp +++ b/src/RenderConfigs.cpp @@ -68,6 +68,7 @@ Gbuffer::Gbuffer(size_t geomW, size_t geomH, size_t lightW, size_t lightH) { lightPPC->AddStaticTexture("light", light); lightPPC->AddStaticTexture("depthStencil", depthStencil); lightPPC->AddShaderParameter("dayTime", Gal::Type::Float); + lightPPC->AddShaderParameter("renderBuff", Gal::Type::Int32); lightPPC->SetVertexShader(gal->LoadVertexShader(vertexSource)); lightPPC->SetPixelShader(gal->LoadPixelShader(pixelSource)); diff --git a/src/RenderConfigs.hpp b/src/RenderConfigs.hpp index 94e96bb..9b535ca 100644 --- a/src/RenderConfigs.hpp +++ b/src/RenderConfigs.hpp @@ -41,4 +41,12 @@ public: void SetDayTime(float dayTime) { lightPipeline->SetShaderParameter("dayTime", dayTime); } + + int GetMaxRenderBuffers() { + return 5; + } + + void SetRenderBuff(int renderBuff) { + lightPipeline->SetShaderParameter("renderBuff", renderBuff); + } }; |