diff options
author | Elisey Puzko <puzko.e02@gmail.com> | 2018-02-23 10:47:46 +0100 |
---|---|---|
committer | Elisey Puzko <puzko.e02@gmail.com> | 2018-02-23 10:47:46 +0100 |
commit | 05126872d522a3a031086dcce866de9643f38c3f (patch) | |
tree | 6e2a88e0f97901e2f0d0853271348b8610df9f4b /src | |
parent | Removed redundant header (diff) | |
download | AltCraft-05126872d522a3a031086dcce866de9643f38c3f.tar AltCraft-05126872d522a3a031086dcce866de9643f38c3f.tar.gz AltCraft-05126872d522a3a031086dcce866de9643f38c3f.tar.bz2 AltCraft-05126872d522a3a031086dcce866de9643f38c3f.tar.lz AltCraft-05126872d522a3a031086dcce866de9643f38c3f.tar.xz AltCraft-05126872d522a3a031086dcce866de9643f38c3f.tar.zst AltCraft-05126872d522a3a031086dcce866de9643f38c3f.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Render.cpp | 4 | ||||
-rw-r--r-- | src/RendererSection.cpp | 6 | ||||
-rw-r--r-- | src/World.cpp | 1 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/Render.cpp b/src/Render.cpp index c905bd9..5c00d91 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -245,7 +245,7 @@ void Render::HandleEvents() { } case SDL_MOUSEBUTTONDOWN: { - if (!ImGui::GetIO().WantCaptureMouse) { + if (isMouseCaptured && !ImGui::GetIO().WantCaptureMouse) { if (event.button.button == SDL_BUTTON_LEFT) PUSH_EVENT("LmbPressed", 0); else if (event.button.button == SDL_BUTTON_RIGHT) @@ -256,7 +256,7 @@ void Render::HandleEvents() { } case SDL_MOUSEBUTTONUP: { - if (!ImGui::GetIO().WantCaptureMouse) { + if (isMouseCaptured && !ImGui::GetIO().WantCaptureMouse) { if (event.button.button == SDL_BUTTON_LEFT) PUSH_EVENT("LmbReleased", 0); else if (event.button.button == SDL_BUTTON_RIGHT) diff --git a/src/RendererSection.cpp b/src/RendererSection.cpp index 23b0a42..0311171 100644 --- a/src/RendererSection.cpp +++ b/src/RendererSection.cpp @@ -162,12 +162,10 @@ void RendererSection::Render(RenderState &renderState) { glCheckError(); } -Vector RendererSection::GetPosition() -{ +Vector RendererSection::GetPosition() { return sectionPos; } -size_t RendererSection::GetHash() -{ +size_t RendererSection::GetHash() { return hash; }
\ No newline at end of file diff --git a/src/World.cpp b/src/World.cpp index 110b16b..59399f5 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -138,6 +138,7 @@ const Section &World::GetSection(Vector sectionPos) { } } +// TODO: skip liquid blocks RaycastResult World::Raycast(glm::vec3 position, glm::vec3 direction) { const float maxLen = 5.0; const float step = 0.01; |