summaryrefslogtreecommitdiffhomepage
path: root/tile-atlas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tile-atlas.cpp')
-rw-r--r--tile-atlas.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/tile-atlas.cpp b/tile-atlas.cpp
index 67d5df7f..bc2db18e 100644
--- a/tile-atlas.cpp
+++ b/tile-atlas.cpp
@@ -22,8 +22,9 @@ tile_atlas::tile_atlas(const ImageView2D& image, Vector2i dims) :
.setSubImage(0, {}, image);
}
-std::array<Vector2, 4> tile_atlas::texcoords_for_id(int id_) const
+std::array<Vector2, 4> tile_atlas::texcoords_for_id(std::size_t id2) const
{
+ auto id_ = (int)id2;
CORRADE_INTERNAL_ASSERT(id_ >= 0 && id_ < dims_.product());
Vector2i id = { id_ % dims_[0], id_ / dims_[0] };
auto p0 = Vector2(id * tile_size_) / Vector2(size_);
@@ -94,14 +95,4 @@ vertex_array_type tile_atlas::wall_quad_N(Vector3 center, Vector3 size)
}};
}
-std::array<UnsignedShort, 6> tile_atlas::indices(int N)
-{
- CORRADE_INTERNAL_ASSERT(N >= 0);
- using u16 = UnsignedShort;
- return { /* 3--1 1 */
- (u16)(0+N*4), (u16)(1+N*4), (u16)(2+N*4), /* | / /| */
- (u16)(2+N*4), (u16)(1+N*4), (u16)(3+N*4), /* |/ / | */
- }; /* 2 2--0 */
-}
-
} // namespace Magnum::Examples