From f6f40571094abf75e71827a13364e9361c51dffd Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Tue, 3 Oct 2023 21:57:09 +0200 Subject: [PATCH] update player debug variables in main instead of chunkmgr --- src/chunkmanager.cpp | 10 ---------- src/main.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/chunkmanager.cpp b/src/chunkmanager.cpp index 917e476..97b0adf 100644 --- a/src/chunkmanager.cpp +++ b/src/chunkmanager.cpp @@ -121,16 +121,6 @@ namespace chunkmanager int chunkY=static_cast(theCamera.getAtomicPosY() / CHUNK_SIZE); int chunkZ=static_cast(theCamera.getAtomicPosZ() / CHUNK_SIZE); - debug::window::set_parameter("px", theCamera.getAtomicPosX()); - debug::window::set_parameter("py", theCamera.getAtomicPosY()); - debug::window::set_parameter("pz", theCamera.getAtomicPosZ()); - debug::window::set_parameter("cx", chunkX); - debug::window::set_parameter("cy", chunkY); - debug::window::set_parameter("cz", chunkZ); - debug::window::set_parameter("lx", theCamera.getFront().x); - debug::window::set_parameter("ly", theCamera.getFront().y); - debug::window::set_parameter("lz", theCamera.getFront().z); - // Update other chunks for(int i = 0; i < chunks_volume_real; i++) { const uint16_t x = chunks_indices[i][0] + chunkX; diff --git a/src/main.cpp b/src/main.cpp index 1f185f4..70d0a44 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,6 +99,15 @@ int main() // Camera theCamera.update(window, deltaTime); + debug::window::set_parameter("px", theCamera.getPos().x); + debug::window::set_parameter("py", theCamera.getPos().y); + debug::window::set_parameter("pz", theCamera.getPos().z); + debug::window::set_parameter("cx", (int)(theCamera.getPos().x / CHUNK_SIZE)); + debug::window::set_parameter("cy", (int)(theCamera.getPos().y / CHUNK_SIZE)); + debug::window::set_parameter("cz", (int)(theCamera.getPos().z / CHUNK_SIZE)); + debug::window::set_parameter("lx", theCamera.getFront().x); + debug::window::set_parameter("ly", theCamera.getFront().y); + debug::window::set_parameter("lz", theCamera.getFront().z); // Reset blockping timeout if 200ms have passed if(glfwGetTime() - lastBlockPick > 0.1) blockpick = false;