diff --git a/src/client/clientmap.h b/src/client/clientmap.h
index b47beb670..8817f6cac 100644
--- a/src/client/clientmap.h
+++ b/src/client/clientmap.h
@@ -35,32 +35,30 @@ along with Freeminer. If not, see .
struct MapDrawControl
{
-// freeminer:
- int32_t farmesh = 30000;
- uint16_t farmesh_quality = 0;
- bool farmesh_stable = false;
- int32_t lodmesh = 4;
- int cell_size = 1;
- uint8_t cell_size_pow = 0;
- uint8_t farmesh_quality_pow = 0;
-
- float fps = 30;
- float fps_avg = 30;
- float fps_wanted = 30;
- float drawtime_avg = 30;
-
- float fov = 180;
- float fov_add = 0;
- float fov_want = 180; // smooth change
-
- float farthest_drawn = 0;
-
- //bool block_overflow;
+ // freeminer:
+ int32_t farmesh{30000};
+ uint16_t farmesh_quality{};
+ bool farmesh_stable{};
+ int32_t lodmesh{4};
+ int cell_size{1};
+ uint8_t cell_size_pow{};
+ uint8_t farmesh_quality_pow{};
+
+ float fps{30};
+ float fps_avg{30};
+ float fps_wanted{30};
+ float drawtime_avg{30};
+
+ float fov{180};
+ float fov_add{};
+ float fov_want{180}; // smooth change
+
+ float farthest_drawn{};
+
void fm_init();
- MapDrawControl() {
- fm_init();
- }
-// ==
+ MapDrawControl() { fm_init(); }
+ // ==
+
// Wanted drawing range
std::atomic_int32_t wanted_range = 0.0f;
diff --git a/src/client/fm_farmesh.cpp b/src/client/fm_farmesh.cpp
index daebe001b..df3205a8a 100644
--- a/src/client/fm_farmesh.cpp
+++ b/src/client/fm_farmesh.cpp
@@ -102,7 +102,7 @@ void FarMesh::makeFarBlock(
}
block->far_iteration = far_iteration_complete;
if (new_block) {
- last_async = std::async(std::launch::async,
+ std::async(std::launch::async,
[this, block]() mutable { m_client->createFarMesh(block); });
}
return;
@@ -249,7 +249,6 @@ FarMesh::FarMesh(Client *client, Server *server, MapDrawControl *control) :
FarMesh::~FarMesh()
{
- last_async.wait();
}
auto align_shift(auto pos, const auto amount)
@@ -431,8 +430,9 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
//float brightness,
int render_range, float speed)
{
- if (!mg)
+ if (!mg) {
return {};
+ }
m_speed = speed;
@@ -451,8 +451,9 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
m_camera_pos_aligned.getDistanceFrom(camera_pos_aligned_int) > 1000);
const auto set_new_cam_pos = [&]() {
- if (m_camera_pos_aligned == camera_pos_aligned_int)
+ if (m_camera_pos_aligned == camera_pos_aligned_int) {
return false;
+ }
++far_iteration_complete;
@@ -471,8 +472,9 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
set_new_cam_pos();
}
clientMap.far_blocks_last_cam_pos = m_camera_pos_aligned;
- if (!last_distance_max)
+ if (!last_distance_max) {
last_distance_max = distance_max;
+ }
}
if (complete_set) {
@@ -499,8 +501,9 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
break;
}
#endif
- if (!plane_processed[i].processed)
+ if (!plane_processed[i].processed) {
continue;
+ }
++planes_processed;
async[i].step([this, i = i]() {
//for (int depth = 0; depth < 100; ++depth) {
@@ -517,15 +520,17 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
}
bool cam_pos_updated{};
- if (far_fast || !planes_processed)
+ if (far_fast || !planes_processed) {
cam_pos_updated = set_new_cam_pos();
+ }
if (!cam_pos_updated) {
if (!planes_processed && !complete_set) {
clientMap.far_blocks_last_cam_pos = m_camera_pos_aligned;
clientMap.far_iteration_use = far_iteration_complete;
- if (far_iteration_complete)
+ if (far_iteration_complete) {
clientMap.far_iteration_clean = far_iteration_complete - 1;
+ }
complete_set = true;
}
} else if (far_fast) {
diff --git a/src/client/fm_farmesh.h b/src/client/fm_farmesh.h
index 10e3b8833..36cda5ccd 100644
--- a/src/client/fm_farmesh.h
+++ b/src/client/fm_farmesh.h
@@ -113,6 +113,4 @@ class FarMesh
concurrent_shared_unordered_map>
far_blocks_list;
std::array async;
-
- std::future last_async;
};
diff --git a/src/fm_world_merge.cpp b/src/fm_world_merge.cpp
index eeec96cbd..1a4fe3924 100644
--- a/src/fm_world_merge.cpp
+++ b/src/fm_world_merge.cpp
@@ -345,7 +345,6 @@ bool WorldMerger::merge_all()
bool WorldMerger::merge_changed()
{
- DUMP("wantmerge", changed_blocks_for_merge.size());
if (!changed_blocks_for_merge.empty()) {
const auto res = merge_list(changed_blocks_for_merge);
changed_blocks_for_merge.clear();