summaryrefslogtreecommitdiffstats
path: root/src/Render.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-27 06:10:33 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-27 06:10:33 +0100
commite2479261c56c8d1a64b51ad4f084ad3c18505359 (patch)
tree5256688eaec174cebdcf873f5247ece28ec45b9c /src/Render.cpp
parentAdded slow GameState sync (diff)
downloadAltCraft-e2479261c56c8d1a64b51ad4f084ad3c18505359.tar
AltCraft-e2479261c56c8d1a64b51ad4f084ad3c18505359.tar.gz
AltCraft-e2479261c56c8d1a64b51ad4f084ad3c18505359.tar.bz2
AltCraft-e2479261c56c8d1a64b51ad4f084ad3c18505359.tar.lz
AltCraft-e2479261c56c8d1a64b51ad4f084ad3c18505359.tar.xz
AltCraft-e2479261c56c8d1a64b51ad4f084ad3c18505359.tar.zst
AltCraft-e2479261c56c8d1a64b51ad4f084ad3c18505359.zip
Diffstat (limited to 'src/Render.cpp')
-rw-r--r--src/Render.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Render.cpp b/src/Render.cpp
index 5432979..0268bee 100644
--- a/src/Render.cpp
+++ b/src/Render.cpp
@@ -348,6 +348,9 @@ void Render::SetMouseCapture(bool IsCaptured) {
}
void Render::Update() {
+ if (world)
+ world->UpdateGameState(GlobalState::GetGameState());
+
HandleEvents();
if (HasFocus && GlobalState::GetState() == State::Playing) UpdateKeyboard();
if (isMouseCaptured) HandleMouseCapture();
@@ -384,8 +387,7 @@ void Render::RenderGui() {
if (world) {
Entity *playerPtr = world->GameStatePtr()->GetPlayer();
SelectionStatus selectionStatus = world->GameStatePtr()->GetSelectionStatus();
- World worldObj = world->GameStatePtr()->GetWorld();
- World *worldPtr = &worldObj;
+ World *worldPtr = &world->GameStatePtr()->GetWorld();
ImGui::Text("TPS: %.1f (%.2fms)", 1000.0f / gameTime, gameTime);
ImGui::Text("Sections loaded: %d", (int) DebugInfo::totalSections);