From 8ac4fe6d5ba5091923c7fdf1fa88724d827706fa Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 26 May 2017 19:11:17 +0500 Subject: 2017-05-26 --- src/core/Core.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/core/Core.cpp') diff --git a/src/core/Core.cpp b/src/core/Core.cpp index 54a16a4..7814c32 100644 --- a/src/core/Core.cpp +++ b/src/core/Core.cpp @@ -108,6 +108,7 @@ Core::Core() { gameState = new GameState(client); std::thread loop = std::thread(&Core::UpdateGameState,this); std::swap(loop,gameStateLoopThread); + assetManager = new AssetManager; LOG(INFO) << "Core is initialized"; } @@ -291,13 +292,8 @@ void Core::RenderWorld(World &Target) { glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glUniform1i(blockLoc, block.id); - std::string textureName = AssetManager::GetAssetNameByBlockId(block.id); - if (textureName.find("air") != std::string::npos) - continue; - Texture &texture1 = *(AssetManager::GetAsset(textureName).data.texture); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, texture1.texture); + //glBindTexture(GL_TEXTURE_2D, texture1.texture); glUniform1i(glGetUniformLocation(shader->Program, "blockTexture"), 0); glDrawArrays(GL_TRIANGLES, 0, 36); @@ -316,7 +312,6 @@ void Core::SetMouseCapture(bool IsCaptured) { } void Core::PrepareToWorldRendering() { - glGenBuffers(1, &VBO); glGenBuffers(1, &VBO2); glGenVertexArrays(1, &VAO); -- cgit v1.2.3