Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Oct 12, 2024
1 parent 8747a51 commit b87c8a5
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/client/fm_farmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void FarMesh::makeFarBlock(

void FarMesh::makeFarBlocks(const v3bpos_t &blockpos, MapBlock::block_step_t step)
{
#if FARMESH_DEBUG || FARMESH_FAST || 1
#if FARMESH_DEBUG || FARMESH_FAST
{
auto block_step_correct =
getFarStep(m_client->getEnv().getClientMap().getControl(),
Expand All @@ -138,14 +138,14 @@ void FarMesh::makeFarBlocks(const v3bpos_t &blockpos, MapBlock::block_step_t ste
v3pos_t(0, -1, 0), // bottom
};
const auto &use_dirs = near;
const auto step_width = 1 << step;
const auto step_width = 1 << (step - 1);
for (const auto &dir : use_dirs) {
const auto bpos = blockpos + dir * step_width;
const auto bpos_dir = blockpos + dir * step_width;
const auto &control = m_client->getEnv().getClientMap().getControl();
const auto bpos = getFarActual(
bpos_dir, getNodeBlockPos(m_camera_pos_aligned), step, control);
auto block_step_correct =
getFarStep(m_client->getEnv().getClientMap().getControl(),
getNodeBlockPos(m_camera_pos_aligned), bpos);
if (!block_step_correct)
continue;
getFarStep(control, getNodeBlockPos(m_camera_pos_aligned), bpos);
makeFarBlock(bpos, block_step_correct);
}
}
Expand Down Expand Up @@ -465,15 +465,17 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
last_distance_max = distance_max;
}

if (last_distance_max < distance_max) {
plane_processed.fill({});
last_distance_max = distance_max; // * 1.1;
}
if (m_client->m_new_farmeshes) {
m_client->m_new_farmeshes = 0;
plane_processed.fill({});
}
if (complete_set) {
if (last_distance_max < distance_max) {
plane_processed.fill({});
last_distance_max = distance_max; // * 1.1;
}

if (m_client->m_new_farmeshes) {
m_client->m_new_farmeshes = 0;
plane_processed.fill({});
}
}
/*
if (mg->surface_2d()) {
// TODO: use fast simple quadtree based direct mesh create
Expand Down

0 comments on commit b87c8a5

Please sign in to comment.