summaryrefslogtreecommitdiffhomepage
path: root/atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-06-25 15:18:46 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-06-25 15:18:46 +0200
commitdad4ae54192bd420aaf7b8816a953c0e42a93dd6 (patch)
tree152784b004869440ed1e7a4d588163d63d121f8f /atlas.cpp
parent8e6ad9cd70156ad47a7ad11ef5d59aa2ac06aea9 (diff)
.
Diffstat (limited to 'atlas.cpp')
-rw-r--r--atlas.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/atlas.cpp b/atlas.cpp
index e1a1a4b7..041df3f8 100644
--- a/atlas.cpp
+++ b/atlas.cpp
@@ -5,7 +5,7 @@
namespace Magnum::Examples {
-atlas_texture::atlas_texture(const ImageView2D& image, Vector2i dims) :
+texture_atlas::texture_atlas(const ImageView2D& image, Vector2i dims) :
size_{image.size()},
dims_{dims},
tile_size_{size_ / dims}
@@ -22,7 +22,7 @@ atlas_texture::atlas_texture(const ImageView2D& image, Vector2i dims) :
.setSubImage(0, {}, image);
}
-std::array<Vector2, 4> atlas_texture::texcoords_for_id(int id_) const
+std::array<Vector2, 4> texture_atlas::texcoords_for_id(int id_) const
{
CORRADE_INTERNAL_ASSERT(id_ >= 0 && id_ < dims_.product());
Vector2i id = { id_ % dims_[0], id_ / dims_[0] };
@@ -37,9 +37,9 @@ std::array<Vector2, 4> atlas_texture::texcoords_for_id(int id_) const
}};
}
-using vertex_array_type = atlas_texture::vertex_array_type;
+using vertex_array_type = texture_atlas::vertex_array_type;
-vertex_array_type atlas_texture::floor_quad(Vector3 center, Vector2 size)
+vertex_array_type texture_atlas::floor_quad(Vector3 center, Vector2 size)
{
float x = size[0]*.5f, y = size[1]*.5f;
return {{
@@ -50,7 +50,7 @@ vertex_array_type atlas_texture::floor_quad(Vector3 center, Vector2 size)
}};
}
-vertex_array_type atlas_texture::wall_quad_W(Vector3 center, Vector3 size)
+vertex_array_type texture_atlas::wall_quad_W(Vector3 center, Vector3 size)
{
float x = size[0]*.5f, y = size[1]*.5f, z = size[2];
return {{
@@ -61,7 +61,7 @@ vertex_array_type atlas_texture::wall_quad_W(Vector3 center, Vector3 size)
}};
}
-vertex_array_type atlas_texture::wall_quad_S(Vector3 center, Vector3 size)
+vertex_array_type texture_atlas::wall_quad_S(Vector3 center, Vector3 size)
{
float x = size[0]*.5f, y = size[1]*.5f, z = size[2];
return {{
@@ -72,7 +72,7 @@ vertex_array_type atlas_texture::wall_quad_S(Vector3 center, Vector3 size)
}};
}
-vertex_array_type atlas_texture::wall_quad_E(Vector3 center, Vector3 size)
+vertex_array_type texture_atlas::wall_quad_E(Vector3 center, Vector3 size)
{
float x = size[0]*.5f, y = size[1]*.5f, z = size[2];
return {{
@@ -83,7 +83,7 @@ vertex_array_type atlas_texture::wall_quad_E(Vector3 center, Vector3 size)
}};
}
-vertex_array_type atlas_texture::wall_quad_N(Vector3 center, Vector3 size)
+vertex_array_type texture_atlas::wall_quad_N(Vector3 center, Vector3 size)
{
float x = size[0]*.5f, y = size[1]*.5f, z = size[2];
return {{
@@ -94,7 +94,7 @@ vertex_array_type atlas_texture::wall_quad_N(Vector3 center, Vector3 size)
}};
}
-std::array<UnsignedShort, 6> atlas_texture::indices(int N)
+std::array<UnsignedShort, 6> texture_atlas::indices(int N)
{
CORRADE_INTERNAL_ASSERT(N >= 0);
using u16 = UnsignedShort;