diff --git a/src/Magnum/GL/Test/MeshTest.cpp b/src/Magnum/GL/Test/MeshTest.cpp index e91279b58..ec199c527 100644 --- a/src/Magnum/GL/Test/MeshTest.cpp +++ b/src/Magnum/GL/Test/MeshTest.cpp @@ -182,10 +182,10 @@ void MeshTest::mapPrimitiveInvalid() { Error redirectError{&out}; meshPrimitive(Magnum::MeshPrimitive{}); - meshPrimitive(Magnum::MeshPrimitive(0x123)); + meshPrimitive(Magnum::MeshPrimitive(0x12)); CORRADE_COMPARE(out.str(), "GL::meshPrimitive(): invalid primitive MeshPrimitive(0x0)\n" - "GL::meshPrimitive(): invalid primitive MeshPrimitive(0x123)\n"); + "GL::meshPrimitive(): invalid primitive MeshPrimitive(0x12)\n"); } void MeshTest::mapIndexType() { @@ -221,10 +221,10 @@ void MeshTest::mapIndexTypeInvalid() { Error redirectError{&out}; meshIndexType(Magnum::MeshIndexType(0x0)); - meshIndexType(Magnum::MeshIndexType(0x123)); + meshIndexType(Magnum::MeshIndexType(0x12)); CORRADE_COMPARE(out.str(), "GL::meshIndexType(): invalid type MeshIndexType(0x0)\n" - "GL::meshIndexType(): invalid type MeshIndexType(0x123)\n"); + "GL::meshIndexType(): invalid type MeshIndexType(0x12)\n"); } void MeshTest::debugPrimitive() { diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 5def75eae..793e00920 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -860,8 +860,8 @@ typedef BasicMutableCompressedImageView<1> MutableCompressedImageView1D; typedef BasicMutableCompressedImageView<2> MutableCompressedImageView2D; typedef BasicMutableCompressedImageView<3> MutableCompressedImageView3D; -enum class MeshPrimitive: UnsignedInt; -enum class MeshIndexType: UnsignedInt; +enum class MeshPrimitive: UnsignedByte; +enum class MeshIndexType: UnsignedByte; enum class VertexFormat: UnsignedInt; enum class PixelFormat: UnsignedInt; diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index 23bf1762e..642711792 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -52,7 +52,7 @@ For D3D, corresponds to @m_class{m-doc-external} [D3D_PRIMITIVE_TOPOLOGY](https: for Metal, corresponds to @m_class{m-doc-external} [MTLPrimitiveType](https://developer.apple.com/documentation/metal/mtlprimitivetype?language=objc). See documentation of each value for more information about the mapping. */ -enum class MeshPrimitive: UnsignedInt { +enum class MeshPrimitive: UnsignedByte { /* Zero reserved for an invalid type (but not being a named value) */ /** @@ -148,7 +148,7 @@ for more information about the mapping. Note that not every type is available there, use @ref Vk::hasVkIndexType() to check for its presence. @see @ref meshIndexTypeSize() */ -enum class MeshIndexType: UnsignedInt { +enum class MeshIndexType: UnsignedByte { /* Zero reserved for an invalid type (but not being a named value) */ /** diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/Test/MeshTest.cpp index b1e63acf1..5a492aef8 100644 --- a/src/Magnum/Test/MeshTest.cpp +++ b/src/Magnum/Test/MeshTest.cpp @@ -150,23 +150,23 @@ void MeshTest::indexTypeSizeInvalid() { Error redirectError{&out}; meshIndexTypeSize(MeshIndexType{}); - meshIndexTypeSize(MeshIndexType(0xdead)); + meshIndexTypeSize(MeshIndexType(0xfe)); CORRADE_COMPARE(out.str(), "meshIndexTypeSize(): invalid type MeshIndexType(0x0)\n" - "meshIndexTypeSize(): invalid type MeshIndexType(0xdead)\n"); + "meshIndexTypeSize(): invalid type MeshIndexType(0xfe)\n"); } void MeshTest::debugPrimitive() { std::ostringstream o; - Debug(&o) << MeshPrimitive::TriangleFan << MeshPrimitive(0xdead); - CORRADE_COMPARE(o.str(), "MeshPrimitive::TriangleFan MeshPrimitive(0xdead)\n"); + Debug(&o) << MeshPrimitive::TriangleFan << MeshPrimitive(0xfe); + CORRADE_COMPARE(o.str(), "MeshPrimitive::TriangleFan MeshPrimitive(0xfe)\n"); } void MeshTest::debugIndexType() { std::ostringstream o; - Debug(&o) << MeshIndexType::UnsignedShort << MeshIndexType(0xdead); - CORRADE_COMPARE(o.str(), "MeshIndexType::UnsignedShort MeshIndexType(0xdead)\n"); + Debug(&o) << MeshIndexType::UnsignedShort << MeshIndexType(0xfe); + CORRADE_COMPARE(o.str(), "MeshIndexType::UnsignedShort MeshIndexType(0xfe)\n"); } void MeshTest::configurationPrimitive() { diff --git a/src/Magnum/Vk/Test/EnumsTest.cpp b/src/Magnum/Vk/Test/EnumsTest.cpp index 3896e1a5e..05cf72792 100644 --- a/src/Magnum/Vk/Test/EnumsTest.cpp +++ b/src/Magnum/Vk/Test/EnumsTest.cpp @@ -158,14 +158,14 @@ void EnumsTest::mapVkPrimitiveTopologyInvalid() { Error redirectError{&out}; hasVkPrimitiveTopology(Magnum::MeshPrimitive{}); - hasVkPrimitiveTopology(Magnum::MeshPrimitive(0x123)); + hasVkPrimitiveTopology(Magnum::MeshPrimitive(0x12)); vkPrimitiveTopology(Magnum::MeshPrimitive{}); - vkPrimitiveTopology(Magnum::MeshPrimitive(0x123)); + vkPrimitiveTopology(Magnum::MeshPrimitive(0x12)); CORRADE_COMPARE(out.str(), "Vk::hasVkPrimitiveTopology(): invalid primitive MeshPrimitive(0x0)\n" - "Vk::hasVkPrimitiveTopology(): invalid primitive MeshPrimitive(0x123)\n" + "Vk::hasVkPrimitiveTopology(): invalid primitive MeshPrimitive(0x12)\n" "Vk::vkPrimitiveTopology(): invalid primitive MeshPrimitive(0x0)\n" - "Vk::vkPrimitiveTopology(): invalid primitive MeshPrimitive(0x123)\n"); + "Vk::vkPrimitiveTopology(): invalid primitive MeshPrimitive(0x12)\n"); } void EnumsTest::mapVkIndexType() { @@ -218,14 +218,14 @@ void EnumsTest::mapVkIndexTypeInvalid() { Error redirectError{&out}; hasVkIndexType(Magnum::MeshIndexType(0x0)); - hasVkIndexType(Magnum::MeshIndexType(0x123)); + hasVkIndexType(Magnum::MeshIndexType(0x12)); vkIndexType(Magnum::MeshIndexType(0x0)); - vkIndexType(Magnum::MeshIndexType(0x123)); + vkIndexType(Magnum::MeshIndexType(0x12)); CORRADE_COMPARE(out.str(), "Vk::hasVkIndexType(): invalid type MeshIndexType(0x0)\n" - "Vk::hasVkIndexType(): invalid type MeshIndexType(0x123)\n" + "Vk::hasVkIndexType(): invalid type MeshIndexType(0x12)\n" "Vk::vkIndexType(): invalid type MeshIndexType(0x0)\n" - "Vk::vkIndexType(): invalid type MeshIndexType(0x123)\n"); + "Vk::vkIndexType(): invalid type MeshIndexType(0x12)\n"); } void EnumsTest::mapVkFormatPixelFormat() {