diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-15 23:12:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-15 23:12:05 +0200 |
commit | 0c2e1a070477b91180edda3094442c5329cec4f6 (patch) | |
tree | 10f441f38602f5d1f593a92529f47f276cab8751 /src | |
parent | d5955d35b9fd32b31b4cd7b5b6f286e1b9c43494 (diff) |
a
Diffstat (limited to 'src')
-rw-r--r-- | src/tile-atlas.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tile-atlas.cpp b/src/tile-atlas.cpp index c3b2449c..50f28cd0 100644 --- a/src/tile-atlas.cpp +++ b/src/tile-atlas.cpp @@ -31,12 +31,11 @@ std::array<Vector2, 4> tile_atlas::texcoords_for_id(std::size_t id_) const const Vector2ui id = { (UnsignedInt)id_ % dims_[0], (UnsignedInt)id_ / dims_[0] }; const Vector2 p0(id * sz), p1(sz); const auto x0 = p0.x(), x1 = p1.x()-1, y0 = p0.y(), y1 = p1.y()-1; - Vector2 size{size_}; return {{ - { (x0+x1)/size[0], (y0+y1)/size[1] }, // bottom right - { (x0+x1)/size[0], y0/size[1] }, // top right - { x0/size[0], (y0+y1)/size[1] }, // bottom left - { x0/size[0], y0/size[1] } // top left + { (x0+x1)/size_[0], (y0+y1)/size_[1] }, // bottom right + { (x0+x1)/size_[0], y0/size_[1] }, // top right + { x0/size_[0], (y0+y1)/size_[1] }, // bottom left + { x0/size_[0], y0/size_[1] } // top left }}; } |