mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
content_cao: Support texture animation for upright_sprite (#10020)
This commit is contained in:
parent
e5725dfb8e
commit
9bba52c400
5 changed files with 64 additions and 14 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue