Browse Source

MeshTools: fix a bad corner case in compile().

Having texture coordinates *and* colors is very unusual, nevertheless it
was a bug.
pull/338/head
Vladimír Vondruš 7 years ago
parent
commit
e1061f1766
  1. 2
      doc/changelog.dox
  2. 2
      src/Magnum/MeshTools/Compile.cpp

2
doc/changelog.dox

@ -297,6 +297,8 @@ See also:
(see [mosra/magnum#331](https://github.com/mosra/magnum/pull/331) (see [mosra/magnum#331](https://github.com/mosra/magnum/pull/331)
- Reading of float textures on ES3 contexts using - Reading of float textures on ES3 contexts using
@ref DebugTools::textureSubImage() returned a zero-sized image by accident @ref DebugTools::textureSubImage() returned a zero-sized image by accident
- @ref MeshTools::compile() was producing an incorrect mesh when
@ref Trade::MeshData3D had both colors and texture coordinates
- Properly zero-initializing the UTF-8 buffer in - Properly zero-initializing the UTF-8 buffer in
@ref Platform::GlfwApplication::textInputEvent() (see @ref Platform::GlfwApplication::textInputEvent() (see
[mosra/magnum#324](https://github.com/mosra/magnum/pull/324)) [mosra/magnum#324](https://github.com/mosra/magnum/pull/324))

2
src/Magnum/MeshTools/Compile.cpp

@ -137,7 +137,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData) {
} }
if(meshData.hasTextureCoords2D()) { if(meshData.hasTextureCoords2D()) {
stride += sizeof(Shaders::Generic3D::TextureCoordinates::Type); stride += sizeof(Shaders::Generic3D::TextureCoordinates::Type);
colorsOffset += sizeof(Shaders::Generic3D::Normal::Type); colorsOffset += sizeof(Shaders::Generic3D::TextureCoordinates::Type);
} }
if(meshData.hasColors()) if(meshData.hasColors())
stride += sizeof(Shaders::Generic3D::Color4::Type); stride += sizeof(Shaders::Generic3D::Color4::Type);

Loading…
Cancel
Save