summaryrefslogtreecommitdiffhomepage
path: root/src/chunk-walls.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-09 17:16:08 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-09 17:16:08 +0100
commitac04d36a63087570964511239c75e94689affc94 (patch)
treec26dee92cd03026ea9c0dd9ef7781edae0bf54c3 /src/chunk-walls.cpp
parenta806c1a9dfeaa8e63df596f73d98ae41f2891b07 (diff)
a
Diffstat (limited to 'src/chunk-walls.cpp')
-rw-r--r--src/chunk-walls.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp
index f8a566be..f523c463 100644
--- a/src/chunk-walls.cpp
+++ b/src/chunk-walls.cpp
@@ -192,7 +192,7 @@ GL::Mesh chunk::make_wall_mesh()
{
CORRADE_ASSUME(G < Group_::COUNT);
- bool corner_ok = false, pillar_ok = false;
+ bool corner_ok = false, pillar_ok = false, side_ok = true;
if (!(dir.*member).is_defined)
continue;
@@ -204,16 +204,15 @@ GL::Mesh chunk::make_wall_mesh()
default:
break;
case Wall::Group_::side:
- if (_walls->atlases[k+1]) // west on same tile
- if (auto t2 = at_offset_(pos, {-1, 0}); !t2 || !t2->wall_north_atlas())
- if (auto t2 = at_offset_(pos, {0, -1}); !t2 || !t2->wall_west_atlas())
- pillar_ok = true;
- if (!pillar_ok) [[likely]]
+ if (auto t = at_offset_(pos, {-1, 0}); !(t && t->wall_north_atlas()))
{
- if (auto t2 = at_offset_(pos, {-1, 0}); !t2 || !t2->wall_north_atlas())
- if (auto t2 = at_offset_(pos, {0, -1}); t2 && t2->wall_west_atlas())
- corner_ok = true;
+ if (_walls->atlases[k+1]) // west on same tile
+ pillar_ok = true;
+ if (auto t = at_offset_(pos, {0, -1}); t && t->wall_west_atlas())
+ corner_ok = true;
}
+ if (auto t = at_offset_(pos, {1, -1}); t && t->wall_west_atlas())
+ side_ok = false;
break;
}
}
@@ -224,11 +223,11 @@ GL::Mesh chunk::make_wall_mesh()
default:
break;
case Wall::Group_::side:
- if (auto t2 = at_offset_(pos, {0, 1}); t2 && t2->wall_north_atlas())
- continue;
- else if (auto t2 = at_offset_(pos, {0, -1}); !t2 || !t2->wall_west_atlas())
- if (auto t2 = at_offset_(pos, {-1, 0}); t2 && t2->wall_north_atlas())
+ if (auto t = at_offset_(pos, {0, -1}); !(t && t->wall_west_atlas()))
+ if (auto t = at_offset_(pos, {-1, 0}); t && t->wall_north_atlas())
corner_ok = true;
+ if (auto t = at_offset_(pos, {-1, 1}); t && t->wall_north_atlas())
+ side_ok = false;
break;
}
}
@@ -312,6 +311,7 @@ GL::Mesh chunk::make_wall_mesh()
}
}
+ if (G != Wall::Group_::side || side_ok) [[likely]]
{
const auto& group = dir.*member;
const auto frames = atlas->frames(group);