From c3472b8abd8185f392e6c2afb68a7411232396d6 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 27 Jan 2019 08:10:36 +0500 Subject: Added slow GameState sync --- src/RendererEntity.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/RendererEntity.cpp') diff --git a/src/RendererEntity.cpp b/src/RendererEntity.cpp index a1c9566..fef7dbd 100644 --- a/src/RendererEntity.cpp +++ b/src/RendererEntity.cpp @@ -4,9 +4,10 @@ #include #include "Entity.hpp" -#include "World.hpp" +#include "GameState.hpp" #include "Renderer.hpp" #include "AssetManager.hpp" +#include "GlobalState.hpp" const GLfloat vertices[] = { -0.5f, 0.5f, 0.5f, @@ -114,9 +115,8 @@ GLuint RendererEntity::GetVao(){ return Vao; } -RendererEntity::RendererEntity(World *ptr, unsigned int id) +RendererEntity::RendererEntity(unsigned int id) { - world = ptr; entityId = id; } @@ -125,7 +125,7 @@ RendererEntity::~RendererEntity() { void RendererEntity::Render(RenderState & renderState) { glm::mat4 model = glm::mat4(1.0); - Entity& entity = world->GetEntity(entityId); + Entity entity = GlobalState::GetGameState()->GetWorld().GetEntity(entityId); model = glm::translate(model, entity.pos.glm()); model = glm::translate(model, glm::vec3(0, entity.height / 2.0, 0)); model = glm::scale(model, glm::vec3(entity.width, entity.height, entity.width)); -- cgit v1.2.3