summaryrefslogtreecommitdiff
path: root/src/client/mesh.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-07-30 17:39:57 +0200
committerGitHub <noreply@github.com>2020-07-30 17:39:57 +0200
commit9bba52c4000a06043f5100dbb0ef66d869707ffc (patch)
tree36d5ac4a64a03a72f17192821611d3045fa50d33 /src/client/mesh.cpp
parente5725dfb8e476a5a6f63f020a23a53ca3ef610e9 (diff)
downloadminetest-9bba52c4000a06043f5100dbb0ef66d869707ffc.tar.gz
minetest-9bba52c4000a06043f5100dbb0ef66d869707ffc.tar.bz2
minetest-9bba52c4000a06043f5100dbb0ef66d869707ffc.zip
content_cao: Support texture animation for upright_sprite (#10020)
Diffstat (limited to 'src/client/mesh.cpp')
-rw-r--r--src/client/mesh.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/mesh.cpp b/src/client/mesh.cpp
index e1ec22068..2400a374c 100644
--- a/src/client/mesh.cpp
+++ b/src/client/mesh.cpp
@@ -203,6 +203,15 @@ void setMeshColor(scene::IMesh *mesh, const video::SColor &color)
setMeshBufferColor(mesh->getMeshBuffer(j), color);
}
+void setMeshBufferTextureCoords(scene::IMeshBuffer *buf, const v2f *uv, u32 count)
+{
+ const u32 stride = getVertexPitchFromType(buf->getVertexType());
+ assert(buf->getVertexCount() >= count);
+ u8 *vertices = (u8 *) buf->getVertices();
+ for (u32 i = 0; i < count; i++)
+ ((video::S3DVertex*) (vertices + i * stride))->TCoords = uv[i];
+}
+
template <typename F>
static void applyToMesh(scene::IMesh *mesh, const F &fn)
{