summaryrefslogtreecommitdiffhomepage
path: root/wall-mesh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wall-mesh.cpp')
-rw-r--r--wall-mesh.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/wall-mesh.cpp b/wall-mesh.cpp
index 31399aed..c55de472 100644
--- a/wall-mesh.cpp
+++ b/wall-mesh.cpp
@@ -48,27 +48,11 @@ void wall_mesh::draw(tile_shader& shader, chunk& c)
c.foreach_tile([&](tile& x, std::size_t, local_coords pt) {
maybe_add_tile(data, textures, pos, x, pt);
});
- //_vertex_buffer.setSubData(0, Containers::arrayView(data.data(), pos));
- _vertex_buffer.setData(data, Magnum::GL::BufferUsage::DynamicDraw);
+ _vertex_buffer.setSubData(0, Containers::arrayView(data.data(), pos));
+ //_vertex_buffer.setData(data, Magnum::GL::BufferUsage::DynamicDraw);
}
const GL::Texture2D* last_texture = nullptr;
-#if 0
- if (pos > 0)
- {
- Magnum::GL::MeshView mesh{_mesh};
- mesh.setCount((int)(pos * quad_index_count));
- mesh.setIndexRange(0);
- textures[0]->bind(0);
- shader.draw(mesh);
- }
-#elif 0
- if (pos > 0)
- {
- textures[0]->bind(0);
- shader.draw(_mesh);
- }
-#else
Magnum::GL::MeshView mesh{_mesh};
for (std::size_t i = 0; i < pos; i++)
{
@@ -76,14 +60,11 @@ void wall_mesh::draw(tile_shader& shader, chunk& c)
CORRADE_INTERNAL_ASSERT(tex != nullptr);
mesh.setCount(quad_index_count);
mesh.setIndexRange((int)(i*quad_index_count), 0, quad_index_count*COUNT - 1);
- //mesh.setIndexRange((int)(i*quad_index_count));
- //Debug{} << "draw " << "i:" << i << "count:" << quad_index_count << "range:" << (i*quad_index_count);
if (tex != last_texture)
tex->bind(0);
last_texture = tex;
shader.draw(mesh);
}
-#endif
}
decltype(wall_mesh::_index_data) wall_mesh::make_index_array()