From 6b2f4711b4b87aeac3d69678529e7e2bf501527d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 1 Dec 2019 19:36:50 +0100 Subject: [PATCH] Primitives: fix an assertion in uvSphereWireframe(). Everything I do these days is a potential breakign change. --- doc/changelog.dox | 4 ++++ src/Magnum/Primitives/UVSphere.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index d7f56c697..5c3111684 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -156,6 +156,10 @@ See also: @ref Platform::Sdl2Application now premultiply the value with @ref Platform::GlfwApplication::dpiScaling() "dpiScaling()" to work independently on display DPI. This might break existing uses. +- @ref Primitives::uvSphereWireframe() now correctly asserts when the + @p segments parameter isn't divisible by four. Before it mistakenly + asserted only if @p segments wasn't divisible by two, and now code that + mistakenly used a disallowed value will start asserting. - Removed remaining APIs deprecated in version 2018.04: - @cpp Audio::Buffer::Format @ce, use @ref Audio::BufferFormat instead - @cpp Shaders::*Vector::setVectorTexture() @ce, diff --git a/src/Magnum/Primitives/UVSphere.cpp b/src/Magnum/Primitives/UVSphere.cpp index d1d889ac1..597310027 100644 --- a/src/Magnum/Primitives/UVSphere.cpp +++ b/src/Magnum/Primitives/UVSphere.cpp @@ -63,7 +63,7 @@ Trade::MeshData3D uvSphereSolid(UnsignedInt rings, UnsignedInt segments, UVSpher } Trade::MeshData3D uvSphereWireframe(const UnsignedInt rings, const UnsignedInt segments) { - CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%2 == 0, + CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%4 == 0, "Primitives::uvSphereWireframe(): multiples of 2 rings and multiples of 4 segments expected", (Trade::MeshData3D{MeshPrimitive::Triangles, {}, {}, {}, {}, {}, nullptr}));