diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-29 18:59:39 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-29 18:59:39 +0200 |
commit | d9cf49f11a5767fab52994e5c38d58ba16b13af6 (patch) | |
tree | 0d9adf6eb81bc75f0c1aaf616efe554ff6c64b56 /draw/wall.cpp | |
parent | d309ed0b2ac06d7ba48322303d56bf39c8b57fe4 (diff) |
use vectors without open-coding vector ops
Suggested by mosra.
Diffstat (limited to 'draw/wall.cpp')
-rw-r--r-- | draw/wall.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/draw/wall.cpp b/draw/wall.cpp index ff3969fd..ae2e848c 100644 --- a/draw/wall.cpp +++ b/draw/wall.cpp @@ -78,15 +78,13 @@ std::array<std::array<UnsignedShort, 6>, wall_mesh::COUNT> wall_mesh::make_index std::array<std::array<Vector3, 4>, wall_mesh::COUNT> wall_mesh::make_position_array() { std::array<std::array<Vector3, 4>, COUNT> array; - constexpr float X = TILE_SIZE[0], Y = TILE_SIZE[1], Z = TILE_SIZE[2]; - constexpr Vector3 size = {X, Y, Z}; for (std::size_t j = 0; j < TILE_MAX_DIM; j++) for (std::size_t i = 0; i < TILE_MAX_DIM; i++) { const auto idx = (j*TILE_MAX_DIM + i) * 2; - Vector3 center{(float)(X*i), (float)(Y*j), 0}; - array[idx + 0] = tile_atlas::wall_quad_N(center, size); - array[idx + 1] = tile_atlas::wall_quad_W(center, size); + const auto center = Vector3((float)i, (float)j, 0) * TILE_SIZE; + array[idx + 0] = tile_atlas::wall_quad_N(center, TILE_SIZE); + array[idx + 1] = tile_atlas::wall_quad_W(center, TILE_SIZE); } return array; } |