From 35cf1d65b454985c38b1e00a91670663b1583670 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 2 Oct 2022 03:23:05 +0200 Subject: a --- tile-mesh.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 tile-mesh.cpp (limited to 'tile-mesh.cpp') diff --git a/tile-mesh.cpp b/tile-mesh.cpp deleted file mode 100644 index c1f819d8..00000000 --- a/tile-mesh.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "tile-mesh.hpp" -#include "tile-shader.hpp" -#include "tile.hpp" - -namespace Magnum::Examples { - -tile_mesh::tile_mesh() -{ - _mesh.setCount((int)index_count) - .addVertexBuffer(_vertex_buffer, 0, - tile_shader::Position{}, tile_shader::TextureCoordinates{}) - .setIndexBuffer(_index_buffer, 0, GL::MeshIndexType::UnsignedShort); -} - -void tile_mesh::draw_quad(tile_shader& shader, tile_image& img, const std::array& positions) -{ - auto texcoords = img.atlas->texcoords_for_id(img.variant); - //auto positions = img.atlas->floor_quad(position, { TILE_SIZE[0], TILE_SIZE[1] }); - for (std::size_t i = 0; i < 4; i++) - _vertex_data[i] = {positions[i], texcoords[i]}; - img.atlas->texture().bind(0); - _vertex_buffer.setData(_vertex_data, Magnum::GL::BufferUsage::DynamicDraw); - shader.draw(_mesh); -} - -void tile_mesh::draw_floor_quad(tile_shader& shader, tile_image& img, Vector3 center) -{ - draw_quad(shader, img, img.atlas->floor_quad(center, { TILE_SIZE[0], TILE_SIZE[1] })); -} - -} // namespace Magnum::Examples -- cgit v1.2.3