diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-07-24 16:52:24 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-07-24 16:52:24 +0200 |
commit | 6a00886804c53883d919f008f6ec47a574d86607 (patch) | |
tree | 2dbe9fdb0a0d5f068770d49a3c960d36958f27d5 /src/graphics | |
parent | 2017-07-21 (diff) | |
download | AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.gz AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.bz2 AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.lz AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.xz AltCraft-6a00886804c53883d919f008f6ec47a574d86607.tar.zst AltCraft-6a00886804c53883d919f008f6ec47a574d86607.zip |
Diffstat (limited to '')
-rw-r--r-- | src/graphics/Gui.hpp (renamed from include/graphics/Gui.hpp) | 1 | ||||
-rw-r--r-- | src/graphics/RenderSection.cpp | 18 | ||||
-rw-r--r-- | src/graphics/RenderSection.hpp (renamed from include/graphics/RenderSection.hpp) | 2 | ||||
-rw-r--r-- | src/graphics/Shader.hpp (renamed from include/graphics/Shader.hpp) | 0 | ||||
-rw-r--r-- | src/graphics/Texture.hpp (renamed from include/graphics/Texture.hpp) | 0 | ||||
-rw-r--r-- | src/graphics/Widget.hpp (renamed from include/graphics/Widget.hpp) | 0 |
6 files changed, 10 insertions, 11 deletions
diff --git a/include/graphics/Gui.hpp b/src/graphics/Gui.hpp index 641b941..e22a0a7 100644 --- a/include/graphics/Gui.hpp +++ b/src/graphics/Gui.hpp @@ -4,4 +4,5 @@ class Gui { public: int WHY=0; + }; diff --git a/src/graphics/RenderSection.cpp b/src/graphics/RenderSection.cpp index 90d4329..ae072d6 100644 --- a/src/graphics/RenderSection.cpp +++ b/src/graphics/RenderSection.cpp @@ -138,7 +138,7 @@ RenderSection::~RenderSection() { refCounterVao[Vao]--; if (refCounterVbo[VboTextures] <= 0) glDeleteBuffers(1, &VboTextures); - + if (refCounterVbo[VboModels] <= 0) glDeleteBuffers(1, &VboTextures); if (refCounterVbo[VboColors] <= 0) @@ -297,13 +297,11 @@ void RenderSection::UpdateState(const std::map<BlockTextureId, glm::vec4> &textu } } numOfFaces = textures.size(); - hash = section.GetHash(); + hash = section.GetHash(); } void RenderSection::Render(RenderState &state) { - if (!isEnabled) { - return; - } + if (!isEnabled) return; if (!models.empty()) { glBindBuffer(GL_ARRAY_BUFFER, VboTextures); glBufferData(GL_ARRAY_BUFFER, textures.size() * sizeof(glm::vec4), textures.data(), GL_DYNAMIC_DRAW); @@ -339,7 +337,7 @@ RenderSection::RenderSection(const RenderSection &other) { this->models = other.models; this->textures = other.textures; this->colors = other.colors; - this->hash = other.hash; + this->hash = other.hash; refCounterVbo[VboTextures]++; refCounterVbo[VboModels]++; @@ -348,11 +346,11 @@ RenderSection::RenderSection(const RenderSection &other) { } void RenderSection::SetEnabled(bool isEnabled) { - this->isEnabled = isEnabled; + this->isEnabled = isEnabled; } bool RenderSection::IsNeedUpdate() { - size_t currentHash = world->GetSection(sectionPosition).GetHash(); - bool isNeedUpdate = currentHash != hash; - return isNeedUpdate; + size_t currentHash = world->GetSection(sectionPosition).GetHash(); + bool isNeedUpdate = currentHash != hash; + return isNeedUpdate; }
\ No newline at end of file diff --git a/include/graphics/RenderSection.hpp b/src/graphics/RenderSection.hpp index 58c4acf..5973909 100644 --- a/include/graphics/RenderSection.hpp +++ b/src/graphics/RenderSection.hpp @@ -7,7 +7,7 @@ #include <glm/gtx/transform.hpp> #include <easylogging++.h> -#include <AssetManager.hpp> +#include <core/AssetManager.hpp> #include <world/Section.hpp> #include <world/World.hpp> diff --git a/include/graphics/Shader.hpp b/src/graphics/Shader.hpp index 17a434e..17a434e 100644 --- a/include/graphics/Shader.hpp +++ b/src/graphics/Shader.hpp diff --git a/include/graphics/Texture.hpp b/src/graphics/Texture.hpp index 277806a..277806a 100644 --- a/include/graphics/Texture.hpp +++ b/src/graphics/Texture.hpp diff --git a/include/graphics/Widget.hpp b/src/graphics/Widget.hpp index c4d5dc1..c4d5dc1 100644 --- a/include/graphics/Widget.hpp +++ b/src/graphics/Widget.hpp |