X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2Fclient.cpp;h=77b7fa63a3ed5f774b5694a4fd53a8e435886738;hb=f506afdcb23fed22f2c7f345b94cb411487f89c9;hp=232ba250eaa9236ff4fd9a4603a85ab9449536f9;hpb=fa73e3600dee78063ab95e1903172ab339dcd4bd;p=blank.git diff --git a/src/client/client.cpp b/src/client/client.cpp index 232ba25..77b7fa6 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -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" @@ -79,9 +80,6 @@ InteractiveState::InteractiveState(MasterState &master, uint32_t player_id) chunk_renderer.FogDensity(master.GetWorldConf().fog_density); loop_timer.Start(); stat_timer.Start(); - if (save.Exists(player)) { - save.Read(player); - } } void InteractiveState::OnResume() { @@ -350,6 +348,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();