summaryrefslogtreecommitdiffhomepage
path: root/src/chunk-render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunk-render.cpp')
-rw-r--r--src/chunk-render.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp
index 48425f72..e54260dd 100644
--- a/src/chunk-render.cpp
+++ b/src/chunk-render.cpp
@@ -12,7 +12,7 @@ template<std::size_t N = 1>
static auto make_index_array(std::size_t max)
{
std::array<std::array<UnsignedShort, 6>, N*TILE_COUNT> array; // NOLINT(cppcoreguidelines-pro-type-member-init)
- for (std::size_t i = 0; i < max; i++)
+ for (auto i = 0_uz; i < max; i++)
array[i] = tile_atlas::indices(i);
return array;
}
@@ -30,7 +30,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
_ground_modified = false;
std::size_t count = 0;
- for (std::size_t i = 0; i < TILE_COUNT; i++)
+ for (auto i = 0_uz; i < TILE_COUNT; i++)
if (_ground_atlases[i])
ground_indexes[count++] = std::uint8_t(i);
@@ -40,7 +40,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
});
std::array<std::array<vertex, 4>, TILE_COUNT> vertexes;
- for (std::size_t k = 0; k < count; k++)
+ for (auto k = 0_uz; k < count; k++)
{
const std::uint8_t i = ground_indexes[k];
const auto& atlas = _ground_atlases[i];
@@ -49,7 +49,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
const auto texcoords = atlas->texcoords_for_id(_ground_variants[i]);
const float depth = tile_shader::depth_value(pos);
auto& v = vertexes[k];
- for (std::size_t j = 0; j < 4; j++)
+ for (auto j = 0_uz; j < 4; j++)
v[j] = { quad[j], texcoords[j], depth };
}
@@ -72,7 +72,7 @@ auto chunk::ensure_wall_mesh() noexcept -> wall_mesh_tuple
_walls_modified = false;
std::size_t count = 0;
- for (std::size_t i = 0; i < TILE_COUNT*2; i++)
+ for (auto i = 0_uz; i < TILE_COUNT*2; i++)
if (_wall_atlases[i])
wall_indexes[count++] = std::uint16_t(i);
@@ -82,7 +82,7 @@ auto chunk::ensure_wall_mesh() noexcept -> wall_mesh_tuple
});
std::array<std::array<vertex, 4>, TILE_COUNT*2> vertexes;
- for (std::size_t k = 0; k < count; k++)
+ for (auto k = 0_uz; k < count; k++)
{
const std::uint16_t i = wall_indexes[k];
const auto& atlas = _wall_atlases[i];
@@ -93,7 +93,7 @@ auto chunk::ensure_wall_mesh() noexcept -> wall_mesh_tuple
const float depth = tile_shader::depth_value(pos);
const auto texcoords = atlas->texcoords_for_id(variant);
auto& v = vertexes[k];
- for (std::size_t j = 0; j < 4; j++)
+ for (auto j = 0_uz; j < 4; j++)
v[j] = { quad[j], texcoords[j], depth, };
}
@@ -116,7 +116,7 @@ auto chunk::ensure_scenery_mesh() noexcept -> scenery_mesh_tuple
_scenery_modified = false;
std::size_t count = 0;
- for (std::size_t i = 0; i < TILE_COUNT; i++)
+ for (auto i = 0_uz; i < TILE_COUNT; i++)
if (const auto& atlas = _scenery_atlases[i]; atlas && atlas->info().fps == 0)
scenery_indexes[count++] = std::uint8_t(i);
@@ -127,7 +127,7 @@ auto chunk::ensure_scenery_mesh() noexcept -> scenery_mesh_tuple
});
#endif
std::array<std::array<vertex, 4>, TILE_COUNT> vertexes;
- for (std::size_t k = 0; k < count; k++)
+ for (auto k = 0_uz; k < count; k++)
{
const std::uint8_t i = scenery_indexes[k];
const local_coords pos{i};
@@ -139,7 +139,7 @@ auto chunk::ensure_scenery_mesh() noexcept -> scenery_mesh_tuple
const auto texcoords = atlas->texcoords_for_frame(fr.r, fr.frame, !group.mirror_from.isEmpty());
const float depth = tile_shader::depth_value(pos, tile_shader::scenery_depth_offset);
auto& v = vertexes[k];
- for (std::size_t j = 0; j < 4; j++)
+ for (auto j = 0_uz; j < 4; j++)
v[j] = { quad[j], texcoords[j], depth };
}