#include <SAnimatedMesh.h>
#include <IAnimatedMeshSceneNode.h>
-// In Irrlicht 1.8 the signature of ITexture::lock was changed from
-// (bool, u32) to (E_TEXTURE_LOCK_MODE, u32).
-#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7
-#define MY_ETLM_READ_ONLY true
-#else
-#define MY_ETLM_READ_ONLY video::ETLM_READ_ONLY
-#endif
-
inline static void applyShadeFactor(video::SColor& color, float factor)
{
color.setRed(core::clamp(core::round32(color.getRed()*factor), 0, 255));
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)
{
// hurting the performance and covering only really weird broken models.
f32 length = buffer->getNormal(0).getLength();
- if (!isfinite(length) || fabs(length) < 1e-10)
+ if (!std::isfinite(length) || length < 1e-10f)
return false;
}