]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/mesh.cpp
Decouple entity minimap markers from nametags replacing with show_on_minimap property...
[dragonfireclient.git] / src / client / mesh.cpp
index 68832849e255c9774881be73e866472e869ffe88..2400a374cb3990a763952842ef1ac64879680a09 100644 (file)
@@ -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)
 {
@@ -341,7 +350,7 @@ bool checkMeshNormals(scene::IMesh *mesh)
                // hurting the performance and covering only really weird broken models.
                f32 length = buffer->getNormal(0).getLength();
 
-               if (!std::isfinite(length) || std::fabs(length) < 1e-10f)
+               if (!std::isfinite(length) || length < 1e-10f)
                        return false;
        }