]> git.localhorst.tv Git - blank.git/blobdiff - src/client/client.cpp
fix comment handling in TokenStreamReader
[blank.git] / src / client / client.cpp
index 5a34976358d8ee74cc4826b464a7d9ff9668a8e6..44d2156538f641991b96ee2c7f07d020ddae4f4b 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "../app/Environment.hpp"
 #include "../app/init.hpp"
+#include "../geometry/distance.hpp"
 #include "../model/Model.hpp"
 #include "../io/WorldSave.hpp"
 #include "../world/ChunkIndex.hpp"
@@ -56,7 +57,7 @@ InteractiveState::InteractiveState(MasterState &master, uint32_t player_id)
 , manip(master.GetEnv().audio, sounds, player.GetEntity())
 , input(world, player, master.GetClient())
 , interface(master.GetConfig(), master.GetEnv().keymap, input, *this)
-, chunk_receiver(world.Chunks(), save)
+, chunk_receiver(master.GetClient(), world.Chunks(), save)
 , chunk_renderer(player.GetChunks())
 , loop_timer(16)
 , stat_timer(1000)
@@ -350,6 +351,14 @@ void InteractiveState::SetDebug(bool b) {
        }
 }
 
+void InteractiveState::NextCamera() {
+       if (iszero(master.GetEnv().viewport.CameraOffset())) {
+               master.GetEnv().viewport.OffsetCamera(glm::vec3(0.0f, 0.0f, -5.0f));
+       } else {
+               master.GetEnv().viewport.OffsetCamera(glm::vec3(0.0f, 0.0f, 0.0f));
+       }
+}
+
 void InteractiveState::Exit() {
        save.Write(player);
        master.Quit();