diff --git a/doc/snippets/MagnumShaderTools.cpp b/doc/snippets/MagnumShaderTools.cpp index 0cc574ae1..5f8aa6f6e 100644 --- a/doc/snippets/MagnumShaderTools.cpp +++ b/doc/snippets/MagnumShaderTools.cpp @@ -27,6 +27,7 @@ #include #include #include +#include /** @todo drop when file callbacks are -free */ #include #include "Magnum/FileCallback.h" diff --git a/src/Magnum/Animation/Player.hpp b/src/Magnum/Animation/Player.hpp index 7966ccee0..daffb120a 100644 --- a/src/Magnum/Animation/Player.hpp +++ b/src/Magnum/Animation/Player.hpp @@ -87,7 +87,7 @@ template Player::Player(Scaler scaler): _scaler{scaler} template Player::~Player() = default; template bool Player::isEmpty() const { - return _tracks.empty(); + return _tracks.isEmpty(); } template std::size_t Player::size() const { @@ -102,7 +102,7 @@ template const TrackViewStorage& Player::track( } template Player& Player::addInternal(const TrackViewStorage& track, void(*const advancer)(const TrackViewStorage&, K, std::size_t&, void*, void(*)(), void*), void* const destination, void(*const userCallback)(), void* const userCallbackData) { - if(_tracks.empty() && _duration == Math::Range1D{}) + if(_tracks.isEmpty() && _duration == Math::Range1D{}) _duration = track.duration(); else _duration = Math::join(track.duration(), _duration); diff --git a/src/Magnum/Animation/Test/TrackTest.cpp b/src/Magnum/Animation/Test/TrackTest.cpp index a7cbc9696..fc67924b2 100644 --- a/src/Magnum/Animation/Test/TrackTest.cpp +++ b/src/Magnum/Animation/Test/TrackTest.cpp @@ -129,10 +129,10 @@ void TrackTest::constructEmpty() { CORRADE_VERIFY(!ca.interpolator()); CORRADE_VERIFY(!ca.size()); - CORRADE_VERIFY(ca.keys().empty()); - CORRADE_VERIFY(ca.keys().empty()); - CORRADE_VERIFY(a.values().empty()); - CORRADE_VERIFY(ca.values().empty()); + CORRADE_VERIFY(ca.keys().isEmpty()); + CORRADE_VERIFY(ca.keys().isEmpty()); + CORRADE_VERIFY(a.values().isEmpty()); + CORRADE_VERIFY(ca.values().isEmpty()); CORRADE_COMPARE(ca.at(42.0f), Vector3{}); } diff --git a/src/Magnum/Animation/Test/TrackViewTest.cpp b/src/Magnum/Animation/Test/TrackViewTest.cpp index 36f175784..0e5206385 100644 --- a/src/Magnum/Animation/Test/TrackViewTest.cpp +++ b/src/Magnum/Animation/Test/TrackViewTest.cpp @@ -126,15 +126,15 @@ void TrackViewTest::constructEmpty() { CORRADE_VERIFY(!a.interpolator()); CORRADE_COMPARE(a.duration(), Range1D{}); CORRADE_VERIFY(!a.size()); - CORRADE_VERIFY(a.keys().empty()); - CORRADE_VERIFY(a.values().empty()); + CORRADE_VERIFY(a.keys().isEmpty()); + CORRADE_VERIFY(a.values().isEmpty()); CORRADE_COMPARE(a.at(42.0f), Vector3{}); CORRADE_VERIFY(!ca.interpolator()); CORRADE_COMPARE(ca.duration(), Range1D{}); CORRADE_VERIFY(!ca.size()); - CORRADE_VERIFY(ca.keys().empty()); - CORRADE_VERIFY(ca.values().empty()); + CORRADE_VERIFY(ca.keys().isEmpty()); + CORRADE_VERIFY(ca.values().isEmpty()); CORRADE_COMPARE(ca.at(42.0f), Vector3{}); } diff --git a/src/Magnum/Animation/Track.h b/src/Magnum/Animation/Track.h index 059e8ce16..74736f244 100644 --- a/src/Magnum/Animation/Track.h +++ b/src/Magnum/Animation/Track.h @@ -290,7 +290,7 @@ template duration() const { - return _data.empty() ? Math::Range1D{} : Math::Range1D{_data.front().first, _data.back().first}; + return _data.isEmpty() ? Math::Range1D{} : Math::Range1D{_data.front().first, _data.back().first}; } /** @brief Keyframe count */ @@ -474,7 +474,7 @@ template class TrackViewStorage { * calculate combined duration for a set of tracks. */ Math::Range1D::type> duration() const { - return _keys.empty() ? Math::Range1D::type>{} : Math::Range1D::type>{_keys.front(), _keys.back()}; + return _keys.isEmpty() ? Math::Range1D::type>{} : Math::Range1D::type>{_keys.front(), _keys.back()}; } /** @brief Keyframe count */ diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index 70b592e56..64987f240 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -36,6 +36,7 @@ #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) #include +#include /** @todo remove once GL::Shader is -free */ #include #include "Magnum/GL/AbstractShaderProgram.h" @@ -83,8 +84,8 @@ FloatReinterpretShader::FloatReinterpretShader() { GL::Shader frag{GL::Version::GLES300, GL::Shader::Type::Fragment}; if(!GL::Context::current().isExtensionSupported()) vert.addSource("#define DISABLE_GL_MAGNUM_shader_vertex_id\n"); - vert.addSource(rs.get("TextureImage.vert")); - frag.addSource(rs.get("TextureImage.frag")); + vert.addSource(rs.getString("TextureImage.vert")); + frag.addSource(rs.getString("TextureImage.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(GL::Shader::compile({vert, frag})); attachShaders({vert, frag}); diff --git a/src/Magnum/GL/AbstractShaderProgram.cpp b/src/Magnum/GL/AbstractShaderProgram.cpp index 8750c260d..aab585448 100644 --- a/src/Magnum/GL/AbstractShaderProgram.cpp +++ b/src/Magnum/GL/AbstractShaderProgram.cpp @@ -471,7 +471,7 @@ AbstractShaderProgram& AbstractShaderProgram::draw(Mesh& mesh, const Containers: #endif AbstractShaderProgram& AbstractShaderProgram::draw(Containers::ArrayView> meshes) { - if(meshes.empty()) return *this; + if(meshes.isEmpty()) return *this; use(); diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 9d662ffdc..ef046e75f 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -974,7 +974,7 @@ bool Context::tryCreate(const Configuration& configuration) { Debug{output} << "OpenGL version:" << versionString(); /* Print the extensions that were disabled above */ - if(!_disabledExtensions.empty()) { + if(!_disabledExtensions.isEmpty()) { Debug{output} << "Disabling extensions:"; for(const Extension& extension: _disabledExtensions) Debug{output} << " " << extension.string(); @@ -985,7 +985,7 @@ bool Context::tryCreate(const Configuration& configuration) { _state = &state.second; /* Print a list of used workarounds */ - if(!_driverWorkarounds.empty()) { + if(!_driverWorkarounds.isEmpty()) { Debug{output} << "Using driver workarounds:"; for(const auto& workaround: _driverWorkarounds) if(!workaround.second) Debug(output) << " " << workaround.first; diff --git a/src/Magnum/GL/Mesh.cpp b/src/Magnum/GL/Mesh.cpp index 485aa28a5..21b6f51bc 100644 --- a/src/Magnum/GL/Mesh.cpp +++ b/src/Magnum/GL/Mesh.cpp @@ -442,7 +442,7 @@ void Mesh::drawInternal(const Containers::ArrayView& counts, "GL::AbstractShaderProgram::draw(): expected" << counts.size() << "index offset items but got" << indexOffsets.size(), ); /* Indexed meshes */ - if(vertexOffsets.empty()) { + if(vertexOffsets.isEmpty()) { #ifndef MAGNUM_TARGET_GLES glMultiDrawElements #else @@ -495,7 +495,7 @@ void Mesh::drawInternal(const Containers::ArrayView& counts, /* Non-indexed instanced meshes */ #ifndef MAGNUM_TARGET_GLES2 - if(instanceOffsets.empty()) + if(instanceOffsets.isEmpty()) #endif { state.multiDrawArraysInstancedImplementation(GLenum(_primitive), reinterpret_cast(vertexOffsets.data()), reinterpret_cast(counts.data()), reinterpret_cast(instanceCounts.data()), counts.size()); @@ -518,9 +518,9 @@ void Mesh::drawInternal(const Containers::ArrayView& counts, "GL::AbstractShaderProgram::draw(): expected" << counts.size() << "index offset items but got" << indexOffsets.size(), ); /* Indexed meshes */ - if(vertexOffsets.empty() + if(vertexOffsets.isEmpty() #ifndef MAGNUM_TARGET_GLES2 - && instanceOffsets.empty() + && instanceOffsets.isEmpty() #endif ) { state.multiDrawElementsInstancedImplementation(GLenum(_primitive), reinterpret_cast(counts.data()), GLenum(_indexType), reinterpret_cast(indexOffsets.data()), reinterpret_cast(instanceCounts.data()), counts.size()); diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index 78e258d85..658fa112e 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp @@ -25,6 +25,7 @@ #include #include +#include /** @todo remove when Shader is -free */ #include #include #include @@ -188,7 +189,7 @@ void AbstractShaderProgramGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - shader.setLabel("DummyShader!"_s.except(1)); + shader.setLabel("DummyShader!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(shader.label(), "DummyShader"); @@ -224,7 +225,7 @@ void AbstractShaderProgramGLTest::create() { Version::GLES200 #endif , Shader::Type::Vertex); - vert.addSource(rs.get("MyShader.vert")); + vert.addSource(rs.getString("MyShader.vert")); const bool vertCompiled = vert.compile(); Shader frag( @@ -238,7 +239,7 @@ void AbstractShaderProgramGLTest::create() { Version::GLES200 #endif , Shader::Type::Fragment); - frag.addSource(rs.get("MyShader.frag")); + frag.addSource(rs.getString("MyShader.frag")); const bool fragCompiled = frag.compile(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -289,7 +290,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { Version::GL310 #endif , Shader::Type::Vertex); - vert.addSource(rs.get("MyShader.vert")); + vert.addSource(rs.getString("MyShader.vert")); const bool vertCompiled = vert.compile(); Shader frag( @@ -299,7 +300,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { Version::GL310 #endif , Shader::Type::Fragment); - frag.addSource(rs.get("MyShaderFragmentOutputs.frag")); + frag.addSource(rs.getString("MyShaderFragmentOutputs.frag")); const bool fragCompiled = frag.compile(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -348,7 +349,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { Version::GL310 #endif , Shader::Type::Vertex); - vert.addSource(rs.get("MyShader.vert")); + vert.addSource(rs.getString("MyShader.vert")); const bool vertCompiled = vert.compile(); Shader frag( @@ -358,7 +359,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { Version::GL310 #endif , Shader::Type::Fragment); - frag.addSource(rs.get("MyShaderFragmentOutputs.frag")); + frag.addSource(rs.getString("MyShaderFragmentOutputs.frag")); const bool fragCompiled = frag.compile(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -496,8 +497,8 @@ MyShader::MyShader() { Version::GLES200 #endif , Shader::Type::Fragment); - vert.addSource(rs.get("MyShader.vert")); - frag.addSource(rs.get("MyShader.frag")); + vert.addSource(rs.getString("MyShader.vert")); + frag.addSource(rs.getString("MyShader.frag")); Shader::compile({vert, frag}); @@ -580,8 +581,8 @@ MyDoubleShader::MyDoubleShader() { Shader vert(Version::GL320, Shader::Type::Vertex); Shader frag(Version::GL320, Shader::Type::Fragment); - vert.addSource(rs.get("MyDoubleShader.vert")); - frag.addSource(rs.get("MyDoubleShader.frag")); + vert.addSource(rs.getString("MyDoubleShader.vert")); + frag.addSource(rs.getString("MyDoubleShader.frag")); Shader::compile({vert, frag}); @@ -675,7 +676,7 @@ void AbstractShaderProgramGLTest::createUniformBlocks() { Version::GLES300 #endif , Shader::Type::Vertex); - vert.addSource(rs.get("UniformBlockShader.vert")); + vert.addSource(rs.getString("UniformBlockShader.vert")); const bool vertCompiled = vert.compile(); Shader frag( @@ -685,7 +686,7 @@ void AbstractShaderProgramGLTest::createUniformBlocks() { Version::GLES300 #endif , Shader::Type::Fragment); - frag.addSource(rs.get("UniformBlockShader.frag")); + frag.addSource(rs.getString("UniformBlockShader.frag")); const bool fragCompiled = frag.compile(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -783,8 +784,8 @@ UniformBlockShader::UniformBlockShader() { Version::GLES300 #endif , Shader::Type::Fragment); - vert.addSource(rs.get("UniformBlockShader.vert")); - frag.addSource(rs.get("UniformBlockShader.frag")); + vert.addSource(rs.getString("UniformBlockShader.vert")); + frag.addSource(rs.getString("UniformBlockShader.frag")); Shader::compile({vert, frag}); attachShaders({vert, frag}); @@ -833,7 +834,7 @@ void AbstractShaderProgramGLTest::compute() { Version::GLES310, #endif Shader::Type::Compute); - compute.addSource(rs.get("ComputeShader.comp")); + compute.addSource(rs.getString("ComputeShader.comp")); CORRADE_INTERNAL_ASSERT_OUTPUT(compute.compile()); attachShader(compute); diff --git a/src/Magnum/GL/Test/BufferGLTest.cpp b/src/Magnum/GL/Test/BufferGLTest.cpp index 49fa30211..ef6d42202 100644 --- a/src/Magnum/GL/Test/BufferGLTest.cpp +++ b/src/Magnum/GL/Test/BufferGLTest.cpp @@ -206,7 +206,7 @@ void BufferGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - buffer.setLabel("MyBuffer!"_s.except(1)); + buffer.setLabel("MyBuffer!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.label(), "MyBuffer"); diff --git a/src/Magnum/GL/Test/BufferTextureGLTest.cpp b/src/Magnum/GL/Test/BufferTextureGLTest.cpp index 558f4faef..18ef283d3 100644 --- a/src/Magnum/GL/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/GL/Test/BufferTextureGLTest.cpp @@ -162,7 +162,7 @@ void BufferTextureGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index 923fbe61e..eaa2afde1 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -151,13 +151,13 @@ void ContextTest::configurationConstruct() { non-null-terminated which blocks the compiler from combining them together. */ #ifndef MAGNUM_TARGET_GLES - const Containers::StringView a = "no-layout-qualifiers-on-old-glsl!"_s.except(1); - const Containers::StringView b = "nv-compressed-block-size-in-bits!"_s.except(1); - const Containers::StringView c = "nv-cubemap-inconsistent-compressed-image-size!"_s.except(1); + const Containers::StringView a = "no-layout-qualifiers-on-old-glsl!"_s.exceptSuffix(1); + const Containers::StringView b = "nv-compressed-block-size-in-bits!"_s.exceptSuffix(1); + const Containers::StringView c = "nv-cubemap-inconsistent-compressed-image-size!"_s.exceptSuffix(1); #elif !defined(MAGNUM_TARGET_WEBGL) - const Containers::StringView a = "swiftshader-no-empty-egl-context-flags!"_s.except(1); - const Containers::StringView b = "swiftshader-egl-context-needs-pbuffer!"_s.except(1); - const Containers::StringView c = "angle-chatty-shader-compiler!"_s.except(1); + const Containers::StringView a = "swiftshader-no-empty-egl-context-flags!"_s.exceptSuffix(1); + const Containers::StringView b = "swiftshader-egl-context-needs-pbuffer!"_s.exceptSuffix(1); + const Containers::StringView c = "angle-chatty-shader-compiler!"_s.exceptSuffix(1); #else /* No general WebGL workarounds to test */ #endif @@ -226,7 +226,7 @@ void ContextTest::configurationConstructUnknownWorkaround() { std::ostringstream out; Warning redirectWarning{&out}; configuration.addDisabledWorkarounds({"all-drivers-are-shit"}); - CORRADE_VERIFY(configuration.disabledWorkarounds().empty()); + CORRADE_VERIFY(configuration.disabledWorkarounds().isEmpty()); CORRADE_COMPARE(out.str(), "GL::Context::Configuration::addDisabledWorkarounds(): unknown workaround all-drivers-are-shit\n"); } @@ -299,8 +299,8 @@ void ContextTest::configurationConstructMove() { Context::Configuration b = std::move(a); CORRADE_COMPARE(UnsignedLong(b.flags()), UnsignedLong(Context::Configuration::Flag::VerboseLog)); - CORRADE_VERIFY(a.disabledWorkarounds().empty()); - CORRADE_VERIFY(a.disabledExtensions().empty()); + CORRADE_VERIFY(a.disabledWorkarounds().isEmpty()); + CORRADE_VERIFY(a.disabledExtensions().isEmpty()); #ifndef MAGNUM_TARGET_WEBGL CORRADE_COMPARE_AS(b.disabledWorkarounds(), Containers::arrayView({workaround}), diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp index 371524522..a40482eab 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp @@ -138,10 +138,10 @@ const struct { std::size_t offset; } PixelStorageData[]{ {"default pixel storage", - Containers::arrayView(Data).suffix(16), {}, - Containers::arrayView(Data).suffix(16), 0}, + Containers::arrayView(Data).exceptPrefix(16), {}, + Containers::arrayView(Data).exceptPrefix(16), 0}, {"skip Z", - Containers::arrayView(Data).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(Data).exceptPrefix(16), PixelStorage{}.setSkip({0, 0, 1}), Containers::arrayView(Data), 16} }; @@ -178,14 +178,14 @@ const struct { std::size_t offset; } CompressedPixelStorageData[]{ {"default pixel storage", - Containers::arrayView(CompressedData).suffix(16*4), + Containers::arrayView(CompressedData).exceptPrefix(16*4), #ifndef MAGNUM_TARGET_GLES {}, #endif - Containers::arrayView(CompressedData).suffix(16*4), 0}, + Containers::arrayView(CompressedData).exceptPrefix(16*4), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Z", - Containers::arrayView(CompressedData).suffix(16*4), + Containers::arrayView(CompressedData).exceptPrefix(16*4), CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) .setCompressedBlockDataSize(16) @@ -217,10 +217,10 @@ const struct { std::size_t offset; } SubPixelStorageData[]{ {"default pixel storage", - Containers::arrayView(SubData).suffix(16), {}, - Containers::arrayView(SubData).suffix(16), 0}, + Containers::arrayView(SubData).exceptPrefix(16), {}, + Containers::arrayView(SubData).exceptPrefix(16), 0}, {"skip Z", - Containers::arrayView(SubData).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(SubData).exceptPrefix(16), PixelStorage{}.setSkip({0, 0, 1}), Containers::arrayView(SubData), 16} }; @@ -251,14 +251,14 @@ const struct { std::size_t offset; } CompressedSubPixelStorageData[]{ {"default pixel storage", - Containers::arrayView(CompressedSubData).suffix(16*4), + Containers::arrayView(CompressedSubData).exceptPrefix(16*4), #ifndef MAGNUM_TARGET_GLES {}, #endif - Containers::arrayView(CompressedSubData).suffix(16*4), 0}, + Containers::arrayView(CompressedSubData).exceptPrefix(16*4), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Z", - Containers::arrayView(CompressedSubData).suffix(16*4), + Containers::arrayView(CompressedSubData).exceptPrefix(16*4), CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) .setCompressedBlockDataSize(16) @@ -396,7 +396,7 @@ void CubeMapTextureArrayGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -641,7 +641,7 @@ void CubeMapTextureArrayGLTest::image() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -676,7 +676,7 @@ void CubeMapTextureArrayGLTest::imageBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -704,7 +704,7 @@ void CubeMapTextureArrayGLTest::imageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -749,7 +749,7 @@ void CubeMapTextureArrayGLTest::compressedImage() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 6})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -797,7 +797,7 @@ void CubeMapTextureArrayGLTest::compressedImageBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 6})); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -832,7 +832,7 @@ void CubeMapTextureArrayGLTest::compressedImageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 6})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -964,7 +964,7 @@ void CubeMapTextureArrayGLTest::subImageQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(SubPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(SubPixelStorageData[testCaseInstanceId()].offset), SubPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -990,7 +990,7 @@ void CubeMapTextureArrayGLTest::subImageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(SubPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(SubPixelStorageData[testCaseInstanceId()].offset), SubPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1017,7 +1017,7 @@ void CubeMapTextureArrayGLTest::subImageQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(SubPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(SubPixelStorageData[testCaseInstanceId()].offset), SubPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1217,7 +1217,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), CompressedSubPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1249,7 +1249,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), CompressedSubPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1280,7 +1280,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), CompressedSubPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } diff --git a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp index b0e0d9d80..34ae4decd 100644 --- a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp @@ -188,11 +188,11 @@ const struct { std::size_t offset; } PixelStorageData[]{ {"default pixel storage", - Containers::arrayView(Data).suffix(8), {}, - Containers::arrayView(Data).suffix(8), 0}, + Containers::arrayView(Data).exceptPrefix(8), {}, + Containers::arrayView(Data).exceptPrefix(8), 0}, #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) {"skip Y", - Containers::arrayView(Data).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data).exceptPrefix(8), PixelStorage{}.setSkip({0, 1, 0}), Containers::arrayView(Data), 8} #endif }; @@ -214,14 +214,14 @@ const struct { std::size_t offset; } CompressedPixelStorageData[]{ {"default pixel storage", - Containers::arrayView(CompressedData).suffix(16), + Containers::arrayView(CompressedData).exceptPrefix(16), #ifndef MAGNUM_TARGET_GLES {}, #endif - Containers::arrayView(CompressedData).suffix(16), 0}, + Containers::arrayView(CompressedData).exceptPrefix(16), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Y", - Containers::arrayView(CompressedData).suffix(16), + Containers::arrayView(CompressedData).exceptPrefix(16), CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) .setCompressedBlockDataSize(16) @@ -259,10 +259,10 @@ const struct { std::size_t offset; } FullPixelStorageData[]{ {"default pixel storage", - Containers::arrayView(FullData).suffix(16), {}, 0}, + Containers::arrayView(FullData).exceptPrefix(16), {}, 0}, #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) {"skip Z", - Containers::arrayView(FullData).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), 16} + Containers::arrayView(FullData).exceptPrefix(16), PixelStorage{}.setSkip({0, 0, 1}), 16} #endif }; @@ -299,14 +299,14 @@ const struct { std::size_t offset; } CompressedFullPixelStorageData[]{ {"default pixel storage", - Containers::arrayView(CompressedFullData).suffix(16*4), + Containers::arrayView(CompressedFullData).exceptPrefix(16*4), #ifndef MAGNUM_TARGET_GLES {}, #endif 0}, #ifndef MAGNUM_TARGET_GLES {"skip Z", - Containers::arrayView(CompressedFullData).suffix(16*4), + Containers::arrayView(CompressedFullData).exceptPrefix(16*4), CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) .setCompressedBlockDataSize(16) @@ -506,7 +506,7 @@ void CubeMapTextureGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -785,7 +785,7 @@ void CubeMapTextureGLTest::storage() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } { @@ -796,7 +796,7 @@ void CubeMapTextureGLTest::storage() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } { @@ -807,7 +807,7 @@ void CubeMapTextureGLTest::storage() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -862,7 +862,7 @@ void CubeMapTextureGLTest::image() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } { @@ -873,7 +873,7 @@ void CubeMapTextureGLTest::image() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } { @@ -884,7 +884,7 @@ void CubeMapTextureGLTest::image() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -923,7 +923,7 @@ void CubeMapTextureGLTest::imageBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -951,7 +951,7 @@ void CubeMapTextureGLTest::imageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1116,7 +1116,7 @@ void CubeMapTextureGLTest::subImageQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1141,7 +1141,7 @@ void CubeMapTextureGLTest::subImageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1166,7 +1166,7 @@ void CubeMapTextureGLTest::subImageQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1214,7 +1214,7 @@ void CubeMapTextureGLTest::compressedImage() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1266,7 +1266,7 @@ void CubeMapTextureGLTest::compressedImageBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1301,7 +1301,7 @@ void CubeMapTextureGLTest::compressedImageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1452,7 +1452,7 @@ void CubeMapTextureGLTest::immutableCompressedImage() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1629,7 +1629,7 @@ void CubeMapTextureGLTest::compressedSubImageQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1659,7 +1659,7 @@ void CubeMapTextureGLTest::compressedSubImageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1776,7 +1776,7 @@ void CubeMapTextureGLTest::compressedSubImageQueryBuffer() { CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); CORRADE_COMPARE_AS( - Containers::arrayCast(imageData).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), + Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorageData[testCaseInstanceId()].offset), CompressedPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1809,7 +1809,7 @@ void CubeMapTextureGLTest::image3D() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && FullPixelStorageData[testCaseInstanceId()].storage != PixelStorage{}, "Mesa drivers can't handle non-default pixel storage for full cubemap image queries."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(FullPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(FullPixelStorageData[testCaseInstanceId()].offset), FullPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1841,7 +1841,7 @@ void CubeMapTextureGLTest::image3DBuffer() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && FullPixelStorageData[testCaseInstanceId()].storage != PixelStorage{}, "Mesa drivers can't handle non-default pixel storage for full cubemap image queries."); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(FullPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(FullPixelStorageData[testCaseInstanceId()].offset), FullPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } #endif @@ -1870,7 +1870,7 @@ void CubeMapTextureGLTest::image3DQueryView() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && FullPixelStorageData[testCaseInstanceId()].storage != PixelStorage{}, "Mesa drivers can't handle non-default pixel storage for full cubemap image queries."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(FullPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(FullPixelStorageData[testCaseInstanceId()].offset), FullPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1961,7 +1961,7 @@ void CubeMapTextureGLTest::compressedImage3D() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && CompressedFullPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{}, "Mesa drivers can't handle non-default pixel storage for full cubemap image queries."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedFullPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedFullPixelStorageData[testCaseInstanceId()].offset), CompressedFullPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2013,7 +2013,7 @@ void CubeMapTextureGLTest::compressedImage3DBuffer() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && CompressedFullPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{}, "Mesa drivers can't handle non-default pixel storage for full cubemap image queries."); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedFullPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedFullPixelStorageData[testCaseInstanceId()].offset), CompressedFullPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2065,7 +2065,7 @@ void CubeMapTextureGLTest::compressedImage3DQueryView() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && CompressedFullPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{}, "Mesa drivers can't handle non-default pixel storage for full cubemap image queries."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedFullPixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedFullPixelStorageData[testCaseInstanceId()].offset), CompressedFullPixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index aa62841d3..e9d1724c3 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/src/Magnum/GL/Test/FramebufferGLTest.cpp @@ -418,7 +418,7 @@ void FramebufferGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - framebuffer.setLabel("MyFramebuffer!"_s.except(1)); + framebuffer.setLabel("MyFramebuffer!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.label(), "MyFramebuffer"); diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index c5e531b87..2015acb61 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/src/Magnum/GL/Test/MeshGLTest.cpp @@ -938,7 +938,7 @@ void MeshGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - mesh.setLabel("MyMesh!"_s.except(1)); + mesh.setLabel("MyMesh!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(mesh.label(), "MyMesh"); diff --git a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp index 27a1b3474..2fb20b56e 100644 --- a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp @@ -201,7 +201,7 @@ void MultisampleTextureGLTest::label2D() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -221,7 +221,7 @@ void MultisampleTextureGLTest::label2DArray() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); diff --git a/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp b/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp index 8022b5139..c5e687171 100644 --- a/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp +++ b/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp @@ -115,7 +115,7 @@ void PipelineStatisticsQueryGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - query.setLabel("MyQuery!"_s.except(1)); + query.setLabel("MyQuery!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(query.label(), "MyQuery"); diff --git a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp index 3599f1bfc..70293f3d2 100644 --- a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp @@ -161,7 +161,7 @@ void PrimitiveQueryGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - query.setLabel("MyQuery!"_s.except(1)); + query.setLabel("MyQuery!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(query.label(), "MyQuery"); diff --git a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp index 96cf0e75d..2cc46d76c 100644 --- a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp @@ -108,11 +108,11 @@ const struct { std::size_t offset; } PixelStorageData[]{ {"default pixel storage", - Containers::arrayView(Data).suffix(8), {}, - Containers::arrayView(Data).suffix(8), 0}, + Containers::arrayView(Data).exceptPrefix(8), {}, + Containers::arrayView(Data).exceptPrefix(8), 0}, #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) {"skip Y", - Containers::arrayView(Data).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data).exceptPrefix(8), PixelStorage{}.setSkip({0, 1, 0}), Containers::arrayView(Data), 8} #endif }; @@ -215,7 +215,7 @@ void RectangleTextureGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -374,7 +374,7 @@ void RectangleTextureGLTest::image() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -401,7 +401,7 @@ void RectangleTextureGLTest::imageBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -427,7 +427,7 @@ void RectangleTextureGLTest::imageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -514,7 +514,7 @@ void RectangleTextureGLTest::subImageQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -540,7 +540,7 @@ void RectangleTextureGLTest::subImageQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -567,7 +567,7 @@ void RectangleTextureGLTest::subImageQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorageData[testCaseInstanceId()].offset), PixelStorageData[testCaseInstanceId()].data, TestSuite::Compare::Container); } diff --git a/src/Magnum/GL/Test/RenderbufferGLTest.cpp b/src/Magnum/GL/Test/RenderbufferGLTest.cpp index fa4453212..349ace274 100644 --- a/src/Magnum/GL/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferGLTest.cpp @@ -156,7 +156,7 @@ void RenderbufferGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - renderbuffer.setLabel("MyRenderbuffer!"_s.except(1)); + renderbuffer.setLabel("MyRenderbuffer!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(renderbuffer.label(), "MyRenderbuffer"); diff --git a/src/Magnum/GL/Test/SampleQueryGLTest.cpp b/src/Magnum/GL/Test/SampleQueryGLTest.cpp index e5728613a..1929de2fb 100644 --- a/src/Magnum/GL/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/GL/Test/SampleQueryGLTest.cpp @@ -150,7 +150,7 @@ void SampleQueryGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - query.setLabel("MyQuery!"_s.except(1)); + query.setLabel("MyQuery!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(query.label(), "MyQuery"); diff --git a/src/Magnum/GL/Test/ShaderGLTest.cpp b/src/Magnum/GL/Test/ShaderGLTest.cpp index 6701a5a4c..5c7978b77 100644 --- a/src/Magnum/GL/Test/ShaderGLTest.cpp +++ b/src/Magnum/GL/Test/ShaderGLTest.cpp @@ -168,7 +168,7 @@ void ShaderGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - shader.setLabel("MyShader!"_s.except(1)); + shader.setLabel("MyShader!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(shader.label(), "MyShader"); diff --git a/src/Magnum/GL/Test/TextureArrayGLTest.cpp b/src/Magnum/GL/Test/TextureArrayGLTest.cpp index 9e0fa4983..417082288 100644 --- a/src/Magnum/GL/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayGLTest.cpp @@ -213,10 +213,10 @@ const struct { std::size_t offset; } PixelStorage1DData[]{ {"default pixel storage", - Containers::arrayView(Data1D).suffix(8), {}, - Containers::arrayView(Data1D).suffix(8), 0}, + Containers::arrayView(Data1D).exceptPrefix(8), {}, + Containers::arrayView(Data1D).exceptPrefix(8), 0}, {"skip Y", - Containers::arrayView(Data1D).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data1D).exceptPrefix(8), PixelStorage{}.setSkip({0, 1, 0}), Containers::arrayView(Data1D), 8}}; #endif @@ -237,10 +237,10 @@ const struct { std::size_t offset; } PixelStorage2DData[]{ {"default pixel storage", - Containers::arrayView(Data2D).suffix(16), {}, - Containers::arrayView(Data2D).suffix(16), 0}, + Containers::arrayView(Data2D).exceptPrefix(16), {}, + Containers::arrayView(Data2D).exceptPrefix(16), 0}, {"skip Z", - Containers::arrayView(Data2D).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(Data2D).exceptPrefix(16), PixelStorage{}.setSkip({0, 0, 1}), Containers::arrayView(Data2D), 16}}; /* Just 4x4x3 0x00 - 0x7f compressed using RGBA DXT3 by the driver */ @@ -263,14 +263,14 @@ const struct { std::size_t offset; } CompressedPixelStorage2DData[]{ {"default pixel storage", - Containers::arrayView(CompressedData2D).suffix(16), + Containers::arrayView(CompressedData2D).exceptPrefix(16), #ifndef MAGNUM_TARGET_GLES {}, #endif - Containers::arrayView(CompressedData2D).suffix(16), 0}, + Containers::arrayView(CompressedData2D).exceptPrefix(16), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Y", - Containers::arrayView(CompressedData2D).suffix(16), + Containers::arrayView(CompressedData2D).exceptPrefix(16), CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) .setCompressedBlockDataSize(16) @@ -520,7 +520,7 @@ void TextureArrayGLTest::label1D() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -540,7 +540,7 @@ void TextureArrayGLTest::label2D() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -955,7 +955,7 @@ void TextureArrayGLTest::image1D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -982,7 +982,7 @@ void TextureArrayGLTest::image1DBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1008,7 +1008,7 @@ void TextureArrayGLTest::image1DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1095,7 +1095,7 @@ void TextureArrayGLTest::subImage1DQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1122,7 +1122,7 @@ void TextureArrayGLTest::subImage1DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1151,7 +1151,7 @@ void TextureArrayGLTest::subImage1DQueryBuffer() { CORRADE_COMPARE(image.size(), Vector2i{2}); /* Was broken on NV since 370.xx (May 2017), fixed in 390.25 (Mar 2018) */ - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1213,7 +1213,7 @@ void TextureArrayGLTest::image2D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1245,7 +1245,7 @@ void TextureArrayGLTest::image2DBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1274,7 +1274,7 @@ void TextureArrayGLTest::image2DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1392,7 +1392,7 @@ void TextureArrayGLTest::subImage2DQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1419,7 +1419,7 @@ void TextureArrayGLTest::subImage2DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1446,7 +1446,7 @@ void TextureArrayGLTest::subImage2DQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1491,7 +1491,7 @@ void TextureArrayGLTest::compressedImage2D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1538,7 +1538,7 @@ void TextureArrayGLTest::compressedImage2DBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1571,7 +1571,7 @@ void TextureArrayGLTest::compressedImage2DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1742,7 +1742,7 @@ void TextureArrayGLTest::compressedSubImage2DQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1775,7 +1775,7 @@ void TextureArrayGLTest::compressedSubImage2DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1811,7 +1811,7 @@ void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } diff --git a/src/Magnum/GL/Test/TextureGLTest.cpp b/src/Magnum/GL/Test/TextureGLTest.cpp index 1a960d475..e46d9ada7 100644 --- a/src/Magnum/GL/Test/TextureGLTest.cpp +++ b/src/Magnum/GL/Test/TextureGLTest.cpp @@ -301,10 +301,10 @@ const struct { std::size_t offset; } PixelStorage1DData[]{ {"default pixel storage", - Containers::arrayView(Data1D).suffix(4), {}, - Containers::arrayView(Data1D).suffix(4), 0}, + Containers::arrayView(Data1D).exceptPrefix(4), {}, + Containers::arrayView(Data1D).exceptPrefix(4), 0}, {"skip X", - Containers::arrayView(Data1D).suffix(4), PixelStorage{}.setSkip({1, 0, 0}), + Containers::arrayView(Data1D).exceptPrefix(4), PixelStorage{}.setSkip({1, 0, 0}), Containers::arrayView(Data1D), 4}}; #endif @@ -322,11 +322,11 @@ const struct { std::size_t offset; } PixelStorage2DData[]{ {"default pixel storage", - Containers::arrayView(Data2D).suffix(8), {}, - Containers::arrayView(Data2D).suffix(8), 0}, + Containers::arrayView(Data2D).exceptPrefix(8), {}, + Containers::arrayView(Data2D).exceptPrefix(8), 0}, #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) {"skip Y", - Containers::arrayView(Data2D).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data2D).exceptPrefix(8), PixelStorage{}.setSkip({0, 1, 0}), Containers::arrayView(Data2D), 8} #endif }; @@ -349,14 +349,14 @@ const struct { std::size_t offset; } CompressedPixelStorage2DData[]{ {"default pixel storage", - Containers::arrayView(CompressedData2D).suffix(16), + Containers::arrayView(CompressedData2D).exceptPrefix(16), #ifndef MAGNUM_TARGET_GLES {}, #endif - Containers::arrayView(CompressedData2D).suffix(16), 0}, + Containers::arrayView(CompressedData2D).exceptPrefix(16), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Y", - Containers::arrayView(CompressedData2D).suffix(16), + Containers::arrayView(CompressedData2D).exceptPrefix(16), CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) .setCompressedBlockDataSize(16) @@ -385,11 +385,11 @@ const struct { std::size_t offset; } PixelStorage3DData[]{ {"default pixel storage", - Containers::arrayView(Data3D).suffix(16), {}, - Containers::arrayView(Data3D).suffix(16), 0}, + Containers::arrayView(Data3D).exceptPrefix(16), {}, + Containers::arrayView(Data3D).exceptPrefix(16), 0}, #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) {"skip Z", - Containers::arrayView(Data3D).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(Data3D).exceptPrefix(16), PixelStorage{}.setSkip({0, 0, 1}), Containers::arrayView(Data3D), 16} #endif }; @@ -422,12 +422,12 @@ const struct { std::size_t offset; } CompressedPixelStorage3DData[]{ {"default pixel storage", - Containers::arrayView(CompressedData3D).suffix(16*4), + Containers::arrayView(CompressedData3D).exceptPrefix(16*4), {}, - Containers::arrayView(CompressedData3D).suffix(16*4), 0}, + Containers::arrayView(CompressedData3D).exceptPrefix(16*4), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Z", - Containers::arrayView(CompressedData3D).suffix(16*4), + Containers::arrayView(CompressedData3D).exceptPrefix(16*4), CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 4}) .setCompressedBlockDataSize(16*4) @@ -795,7 +795,7 @@ void TextureGLTest::label1D() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -815,7 +815,7 @@ void TextureGLTest::label2D() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -834,7 +834,7 @@ void TextureGLTest::label3D() { /* Test the string size gets correctly used, instead of relying on null termination */ - texture.setLabel("MyTexture!"_s.except(1)); + texture.setLabel("MyTexture!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); @@ -1430,7 +1430,7 @@ void TextureGLTest::image1D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1454,7 +1454,7 @@ void TextureGLTest::image1DBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1478,7 +1478,7 @@ void TextureGLTest::image1DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1554,7 +1554,7 @@ void TextureGLTest::subImage1DQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1579,7 +1579,7 @@ void TextureGLTest::subImage1DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1604,7 +1604,7 @@ void TextureGLTest::subImage1DQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage1DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage1DData[testCaseInstanceId()].offset), PixelStorage1DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1677,7 +1677,7 @@ void TextureGLTest::image2D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1706,7 +1706,7 @@ void TextureGLTest::image2DBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1733,7 +1733,7 @@ void TextureGLTest::image2DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1838,7 +1838,7 @@ void TextureGLTest::subImage2DQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1863,7 +1863,7 @@ void TextureGLTest::subImage2DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1888,7 +1888,7 @@ void TextureGLTest::subImage2DQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage2DData[testCaseInstanceId()].offset), PixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -1930,7 +1930,7 @@ void TextureGLTest::compressedImage2D() { CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -1974,7 +1974,7 @@ void TextureGLTest::compressedImage2DBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -2007,7 +2007,7 @@ void TextureGLTest::compressedImage2DQueryView() { CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2143,7 +2143,7 @@ void TextureGLTest::compressedSubImage2DQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2173,7 +2173,7 @@ void TextureGLTest::compressedSubImage2DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2203,7 +2203,7 @@ void TextureGLTest::compressedSubImage2DQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), CompressedPixelStorage2DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2236,7 +2236,7 @@ void TextureGLTest::image3D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage3DData[testCaseInstanceId()].offset), PixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -2265,7 +2265,7 @@ void TextureGLTest::image3DBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage3DData[testCaseInstanceId()].offset), PixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); #endif @@ -2292,7 +2292,7 @@ void TextureGLTest::image3DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage3DData[testCaseInstanceId()].offset), PixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2406,7 +2406,7 @@ void TextureGLTest::subImage3DQuery() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage3DData[testCaseInstanceId()].offset), PixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2431,7 +2431,7 @@ void TextureGLTest::subImage3DQueryView() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(PixelStorage3DData[testCaseInstanceId()].offset), PixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2456,7 +2456,7 @@ void TextureGLTest::subImage3DQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(PixelStorage3DData[testCaseInstanceId()].offset), PixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2496,7 +2496,7 @@ void TextureGLTest::compressedImage3D() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{}, "Mesa drivers can't handle non-default compressed 3D pixel storage."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), CompressedPixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2538,7 +2538,7 @@ void TextureGLTest::compressedImage3DBuffer() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{}, "Mesa drivers can't handle non-default compressed 3D pixel storage."); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), CompressedPixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2573,7 +2573,7 @@ void TextureGLTest::compressedImage3DQueryView() { { CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa) && CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{}, "Mesa drivers can't handle non-default compressed 3D pixel storage."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), CompressedPixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2748,7 +2748,7 @@ void TextureGLTest::compressedSubImage3DQuery() { "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia."); CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa), "Mesa drivers can't handle compressed 3D pixel storage for subimages."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), CompressedPixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2785,7 +2785,7 @@ void TextureGLTest::compressedSubImage3DQueryView() { "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia."); CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa), "Mesa drivers can't handle compressed 3D pixel storage for subimages."); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).exceptPrefix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), CompressedPixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } @@ -2822,7 +2822,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia."); CORRADE_EXPECT_FAIL_IF((Context::current().detectedDriver() & Context::DetectedDriver::Mesa), "Mesa drivers can't handle compressed 3D pixel storage for subimages."); - CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), + CORRADE_COMPARE_AS(Containers::arrayCast(imageData).exceptPrefix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), CompressedPixelStorage3DData[testCaseInstanceId()].data, TestSuite::Compare::Container); } diff --git a/src/Magnum/GL/Test/TimeQueryGLTest.cpp b/src/Magnum/GL/Test/TimeQueryGLTest.cpp index 2383313f8..9c8f5fe0c 100644 --- a/src/Magnum/GL/Test/TimeQueryGLTest.cpp +++ b/src/Magnum/GL/Test/TimeQueryGLTest.cpp @@ -146,7 +146,7 @@ void TimeQueryGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - query.setLabel("MyQuery!"_s.except(1)); + query.setLabel("MyQuery!"_s.exceptSuffix(1)); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(query.label(), "MyQuery"); diff --git a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp index 7cccbfe16..25a3b008f 100644 --- a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp @@ -208,7 +208,7 @@ void TransformFeedbackGLTest::label() { /* Test the string size gets correctly used, instead of relying on null termination */ - feedback.setLabel("MyXfb!"_s.except(1)); + feedback.setLabel("MyXfb!"_s.exceptSuffix(1)); { #ifdef MAGNUM_TARGET_GLES CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia && diff --git a/src/Magnum/Implementation/ImageProperties.h b/src/Magnum/Implementation/ImageProperties.h index 100911f56..dfbc7c1d7 100644 --- a/src/Magnum/Implementation/ImageProperties.h +++ b/src/Magnum/Implementation/ImageProperties.h @@ -70,7 +70,7 @@ template Containers::S static_assert(sizeof(decltype(image.data().front())) == 1, "pointer arithmetic expects image data type to have 1 byte"); - return {data.suffix(properties.first[dimensions - 1]), data + properties.first.sum(), size, stride}; + return {data.exceptPrefix(properties.first[dimensions - 1]), data + properties.first.sum(), size, stride}; } }} diff --git a/src/Magnum/Math/FunctionsBatch.h b/src/Magnum/Math/FunctionsBatch.h index 99b5f4b90..1dd357b82 100644 --- a/src/Magnum/Math/FunctionsBatch.h +++ b/src/Magnum/Math/FunctionsBatch.h @@ -63,7 +63,7 @@ empty, returns @cpp false @ce or a @ref BoolVector with no bits set. @see @ref isInf(T), @ref Constants::inf() */ template auto isInf(const Corrade::Containers::StridedArrayView1D& range) -> decltype(isInf(std::declval())) { - if(range.empty()) return {}; + if(range.isEmpty()) return {}; /* For scalars, this loop exits once any value is infinity. For vectors the loop accumulates the bits and exits as soon as all bits are set @@ -115,7 +115,7 @@ returns @cpp false @ce or a @ref BoolVector with no bits set. @see @ref isNan(T), @ref Constants::nan() */ template inline auto isNan(const Corrade::Containers::StridedArrayView1D& range) -> decltype(isNan(std::declval())) { - if(range.empty()) return {}; + if(range.isEmpty()) return {}; /* For scalars, this loop exits once any value is infinity. For vectors the loop accumulates the bits and exits as soon as all bits are set @@ -200,7 +200,7 @@ ignored, unless the range is all NaNs. @see @ref min(T, T), @ref isNan(const Corrade::Containers::StridedArrayView1D&) */ template inline T min(const Corrade::Containers::StridedArrayView1D& range) { - if(range.empty()) return {}; + if(range.isEmpty()) return {}; std::pair iOut = Implementation::firstNonNan(range, IsFloatingPoint{}, IsVector{}); for(++iOut.first; iOut.first != range.size(); ++iOut.first) @@ -245,7 +245,7 @@ ignored, unless the range is all NaNs. @see @ref max(T, T), @ref isNan(const Corrade::Containers::StridedArrayView1D&) */ template inline T max(const Corrade::Containers::StridedArrayView1D& range) { - if(range.empty()) return {}; + if(range.isEmpty()) return {}; std::pair iOut = Implementation::firstNonNan(range, IsFloatingPoint{}, IsVector{}); for(++iOut.first; iOut.first != range.size(); ++iOut.first) @@ -305,7 +305,7 @@ ignored, unless the range is all NaNs. @ref isNan(const Corrade::Containers::StridedArrayView1D&) */ template inline std::pair minmax(const Corrade::Containers::StridedArrayView1D& range) { - if(range.empty()) return {}; + if(range.isEmpty()) return {}; std::pair iOut = Implementation::firstNonNan(range, IsFloatingPoint{}, IsVector{}); T min{iOut.second}, max{iOut.second}; diff --git a/src/Magnum/MeshTools/Combine.cpp b/src/Magnum/MeshTools/Combine.cpp index 5ded2f7a2..0ca545e2d 100644 --- a/src/Magnum/MeshTools/Combine.cpp +++ b/src/Magnum/MeshTools/Combine.cpp @@ -112,7 +112,7 @@ Trade::MeshData combineIndexedImplementation( } Trade::MeshData combineIndexedAttributes(const Containers::ArrayView> data) { - CORRADE_ASSERT(!data.empty(), + CORRADE_ASSERT(!data.isEmpty(), "MeshTools::combineIndexedAttributes(): no meshes passed", (Trade::MeshData{MeshPrimitive{}, 0})); diff --git a/src/Magnum/MeshTools/Concatenate.cpp b/src/Magnum/MeshTools/Concatenate.cpp index 0ba9e237d..34a0f4e73 100644 --- a/src/Magnum/MeshTools/Concatenate.cpp +++ b/src/Magnum/MeshTools/Concatenate.cpp @@ -95,7 +95,7 @@ Trade::MeshData concatenate(Containers::Array&& indexData, const UnsignedI Trade::MeshData out{meshes.front()->primitive(), /* If the index array is empty, we're creating a non-indexed mesh (not an indexed mesh with zero indices) */ - std::move(indexData), indices.empty() ? + std::move(indexData), indices.isEmpty() ? Trade::MeshIndexData{} : Trade::MeshIndexData{indices}, std::move(vertexData), std::move(attributeData), vertexCount}; /* Create an attribute map. Yes, this is an inevitable fugly thing that @@ -133,7 +133,7 @@ Trade::MeshData concatenate(Containers::Array&& indexData, const UnsignedI /* Otherwise, if we need an index buffer (meaning at least one of the meshes is indexed), generate a trivial index buffer */ - } else if(!indices.empty()) { + } else if(!indices.isEmpty()) { std::iota(indices + indexOffset, indices + indexOffset + mesh.vertexCount(), UnsignedInt(vertexOffset)); indexOffset += mesh.vertexCount(); } @@ -190,7 +190,7 @@ Trade::MeshData concatenate(Containers::Array&& indexData, const UnsignedI } Trade::MeshData concatenate(const Containers::ArrayView> meshes, const InterleaveFlags flags) { - CORRADE_ASSERT(!meshes.empty(), + CORRADE_ASSERT(!meshes.isEmpty(), "MeshTools::concatenate(): expected at least one mesh", (Trade::MeshData{MeshPrimitive::Points, 0})); #ifndef CORRADE_NO_ASSERT @@ -223,7 +223,7 @@ Trade::MeshData concatenate(const Containers::ArrayView indexData{NoInit, indexVertexCount.first*sizeof(UnsignedInt)}; Containers::Array vertexData{ValueInit, - attributeData.empty() ? 0 : (attributeData[0].stride()*indexVertexCount.second)}; + attributeData.isEmpty() ? 0 : (attributeData[0].stride()*indexVertexCount.second)}; return Implementation::concatenate(std::move(indexData), indexVertexCount.second, std::move(vertexData), std::move(attributeData), meshes, "MeshTools::concatenate():"); } diff --git a/src/Magnum/MeshTools/Concatenate.h b/src/Magnum/MeshTools/Concatenate.h index 035a8df8d..5ba5c5d43 100644 --- a/src/Magnum/MeshTools/Concatenate.h +++ b/src/Magnum/MeshTools/Concatenate.h @@ -107,7 +107,7 @@ layout from @p destination is used, all vertex/index data are taken from @p meshes. Expects that @p meshes contains at least one item. */ template class Allocator = Containers::ArrayAllocator> void concatenateInto(Trade::MeshData& destination, Containers::ArrayView> meshes, InterleaveFlags flags = InterleaveFlag::PreserveInterleavedAttributes) { - CORRADE_ASSERT(!meshes.empty(), + CORRADE_ASSERT(!meshes.isEmpty(), "MeshTools::concatenateInto(): no meshes passed", ); #ifndef CORRADE_NO_ASSERT for(std::size_t i = 0; i != destination.attributeCount(); ++i) { @@ -129,7 +129,7 @@ template class Allocator = Containers::ArrayAllocator> void conc Containers::Array attributeData = Implementation::interleavedLayout(std::move(destination), {}, flags); Containers::Array vertexData; - if(!attributeData.empty() && indexVertexCount.second) { + if(!attributeData.isEmpty() && indexVertexCount.second) { const UnsignedInt attributeStride = attributeData[0].stride(); vertexData = destination.releaseVertexData(); /* Resize to 0 and then to the desired size to zero-out whatever was diff --git a/src/Magnum/MeshTools/GenerateNormals.cpp b/src/Magnum/MeshTools/GenerateNormals.cpp index 06e488d0b..1ac005333 100644 --- a/src/Magnum/MeshTools/GenerateNormals.cpp +++ b/src/Magnum/MeshTools/GenerateNormals.cpp @@ -104,7 +104,7 @@ template inline void generateSmoothNormalsIntoImplementation(const Cont CORRADE_ASSERT(normals.size() == positions.size(), "MeshTools::generateSmoothNormalsInto(): bad output size, expected" << positions.size() << "but got" << normals.size(), ); - if(indices.empty()) return; + if(indices.isEmpty()) return; /* Gather count of triangles for every vertex. This abuses the output storage to avoid extra allocations, zero-initialize it first to avoid diff --git a/src/Magnum/MeshTools/Interleave.cpp b/src/Magnum/MeshTools/Interleave.cpp index fc8a0caed..497623b9f 100644 --- a/src/Magnum/MeshTools/Interleave.cpp +++ b/src/Magnum/MeshTools/Interleave.cpp @@ -118,7 +118,7 @@ namespace Implementation { Containers::Array interleavedLayout(Trade::MeshData&& data, const Containers::ArrayView extra, const InterleaveFlags flags) { /* Nothing to do here, bye! */ - if(!data.attributeCount() && extra.empty()) return {}; + if(!data.attributeCount() && extra.isEmpty()) return {}; /* If we're not told to preserve the layout, treat the mesh as noninterleaved always, forcing a repack. Otherwise check if it's already @@ -317,7 +317,7 @@ Trade::MeshData interleave(Trade::MeshData&& data, const Containers::ArrayView vertexData; Containers::Array attributeData; - if(interleaved && extra.empty() && (data.vertexDataFlags() & Trade::DataFlag::Owned)) { + if(interleaved && extra.isEmpty() && (data.vertexDataFlags() & Trade::DataFlag::Owned)) { attributeData = data.releaseAttributeData(); vertexData = data.releaseVertexData(); diff --git a/src/Magnum/MeshTools/RemoveDuplicates.cpp b/src/Magnum/MeshTools/RemoveDuplicates.cpp index 698bcc5ac..4bff989e6 100644 --- a/src/Magnum/MeshTools/RemoveDuplicates.cpp +++ b/src/Magnum/MeshTools/RemoveDuplicates.cpp @@ -66,7 +66,7 @@ struct ArrayHash { std::size_t removeDuplicatesInto(const Containers::StridedArrayView2D& data, const Containers::StridedArrayView1D& indices) { /* Assuming the second dimension is contiguous so we can calculate the hashes easily */ - CORRADE_ASSERT(data.empty()[0] || data.isContiguous<1>(), + CORRADE_ASSERT(data.isEmpty()[0] || data.isContiguous<1>(), "MeshTools::removeDuplicatesInto(): second data view dimension is not contiguous", {}); const std::size_t dataSize = data.size()[0]; @@ -106,7 +106,7 @@ std::pair, std::size_t> removeDuplicates(const Co std::size_t removeDuplicatesInPlaceInto(const Containers::StridedArrayView2D& data, const Containers::StridedArrayView1D& indices) { /* Assuming the second dimension is contiguous so we can calculate the hashes easily */ - CORRADE_ASSERT(data.empty()[0] || data.isContiguous<1>(), + CORRADE_ASSERT(data.isEmpty()[0] || data.isContiguous<1>(), "MeshTools::removeDuplicatesInPlaceInto(): second data view dimension is not contiguous", {}); const std::size_t dataSize = data.size()[0]; diff --git a/src/Magnum/MeshTools/Test/CompileGLTest.cpp b/src/Magnum/MeshTools/Test/CompileGLTest.cpp index 2fad00561..ca78aafbf 100644 --- a/src/Magnum/MeshTools/Test/CompileGLTest.cpp +++ b/src/Magnum/MeshTools/Test/CompileGLTest.cpp @@ -470,9 +470,9 @@ template void CompileGLTest::twoDimensions() { Trade::MeshIndexData indices; if(data.indexType) - indices = Trade::MeshIndexData{*data.indexType, Containers::stridedArrayView(Containers::arrayView(indexData).suffix(3))}; + indices = Trade::MeshIndexData{*data.indexType, Containers::stridedArrayView(Containers::arrayView(indexData).exceptPrefix(3))}; else - indices = Trade::MeshIndexData{Containers::arrayView(indexData).suffix(3)}; + indices = Trade::MeshIndexData{Containers::arrayView(indexData).exceptPrefix(3)}; Trade::MeshData meshData{MeshPrimitive::Triangles, {}, indexData, indices, @@ -704,9 +704,9 @@ template void CompileGLTest::threeDimensions() { Trade::MeshIndexData indices; if(data.indexType) - indices = Trade::MeshIndexData{*data.indexType, Containers::stridedArrayView(Containers::arrayView(indexData).suffix(3))}; + indices = Trade::MeshIndexData{*data.indexType, Containers::stridedArrayView(Containers::arrayView(indexData).exceptPrefix(3))}; else - indices = Trade::MeshIndexData{Containers::arrayView(indexData).suffix(3)}; + indices = Trade::MeshIndexData{Containers::arrayView(indexData).exceptPrefix(3)}; Trade::MeshData meshData{MeshPrimitive::Triangles, {}, indexData, indices, diff --git a/src/Magnum/MeshTools/Test/FullScreenTriangleGLTest.cpp b/src/Magnum/MeshTools/Test/FullScreenTriangleGLTest.cpp index 4ad7b8f55..3bed21b7d 100644 --- a/src/Magnum/MeshTools/Test/FullScreenTriangleGLTest.cpp +++ b/src/Magnum/MeshTools/Test/FullScreenTriangleGLTest.cpp @@ -82,7 +82,7 @@ void FullScreenTriangleGLTest::test() { Utility::Resource rs{"FullScreenTriangleTest"}; GL::Shader vert = Shaders::Implementation::createCompatibilityShader(rs, version, GL::Shader::Type::Vertex); - vert.addSource(rs.get("FullScreenTriangle.glsl")) + vert.addSource(rs.getString("FullScreenTriangle.glsl")) .addSource(R"( void main() { fullScreenTriangle(); diff --git a/src/Magnum/MeshTools/Test/InterleaveTest.cpp b/src/Magnum/MeshTools/Test/InterleaveTest.cpp index 9a4d98c35..72022aea2 100644 --- a/src/Magnum/MeshTools/Test/InterleaveTest.cpp +++ b/src/Magnum/MeshTools/Test/InterleaveTest.cpp @@ -536,8 +536,8 @@ void InterleaveTest::interleavedDataNotInterleaved() { #endif Containers::Array vertexData{100 + 3*20}; - auto positions = Containers::arrayCast(vertexData.suffix(100).prefix(3*8)); - auto normals = Containers::arrayCast(vertexData.suffix(100).suffix(3*8)); + auto positions = Containers::arrayCast(vertexData.exceptPrefix(100).prefix(3*8)); + auto normals = Containers::arrayCast(vertexData.exceptPrefix(100+3*8)); Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals}, @@ -745,7 +745,7 @@ void InterleaveTest::interleavedLayout() { Containers::arrayCast(vertexData.slice(3*8, 3*20))}, /* Array attribute to verify it's correctly propagated */ Trade::MeshAttributeData{Trade::meshAttributeCustom(42), - VertexFormat::Short, Containers::StridedArrayView2D{vertexData.suffix(3*20), {3, 4}}, 2} + VertexFormat::Short, Containers::StridedArrayView2D{vertexData.exceptPrefix(3*20), {3, 4}}, 2} }; Trade::MeshIndexData indices{Containers::arrayCast(indexData)}; @@ -801,7 +801,7 @@ void InterleaveTest::interleavedLayoutExtra() { Trade::MeshAttributeData positions{Trade::MeshAttribute::Position, Containers::arrayCast(vertexData.prefix(3*8))}; Trade::MeshAttributeData normals{Trade::MeshAttribute::Normal, - Containers::arrayCast(vertexData.suffix(3*8))}; + Containers::arrayCast(vertexData.exceptPrefix(3*8))}; Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), {positions, normals}}; @@ -1119,7 +1119,7 @@ void InterleaveTest::interleavedLayoutRvalue() { attributeData[0] = Trade::MeshAttributeData{Trade::MeshAttribute::Position, Containers::arrayCast(vertexData.prefix(3*8))}; attributeData[1] = Trade::MeshAttributeData{Trade::MeshAttribute::Normal, - Containers::arrayCast(vertexData.suffix(3*8))}; + Containers::arrayCast(vertexData.exceptPrefix(3*8))}; const void* originalAttributeData = attributeData.data(); Trade::MeshIndexData indices{Containers::arrayCast(indexData)}; @@ -1190,7 +1190,7 @@ void InterleaveTest::interleaveMeshDataIndexed() { /* Testing also offset */ UnsignedShort indexData[50 + 3]; - Containers::StridedArrayView1D indices = Containers::arrayView(indexData).suffix(50); + Containers::StridedArrayView1D indices = Containers::arrayView(indexData).exceptPrefix(50); if(data.flip) indices = indices.flipped<0>(); Utility::copy({0, 2, 1}, indices); @@ -1446,7 +1446,7 @@ void InterleaveTest::interleaveMeshDataAlreadyInterleavedMoveIndices() { /* Testing also offset */ Containers::Array indexData{(50 + 3)*sizeof(UnsignedShort)}; - Containers::StridedArrayView1D indices = Containers::arrayCast(indexData).suffix(50); + Containers::StridedArrayView1D indices = Containers::arrayCast(indexData).exceptPrefix(50); if(data.flip) indices = indices.flipped<0>(); Utility::copy({0, 2, 1}, indices); diff --git a/src/Magnum/MeshTools/Test/ReferenceTest.cpp b/src/Magnum/MeshTools/Test/ReferenceTest.cpp index 0bd97be6e..805917c2b 100644 --- a/src/Magnum/MeshTools/Test/ReferenceTest.cpp +++ b/src/Magnum/MeshTools/Test/ReferenceTest.cpp @@ -299,7 +299,7 @@ void ReferenceTest::ownedStridedIndices() { const UnsignedShort indices[7]{0, 3, 0, 7, 0, 15, 0}; Trade::MeshData stuff{MeshPrimitive::Points, - {}, indices, Trade::MeshIndexData{data.type, Containers::stridedArrayView(indices).suffix(1).every(2)}, + {}, indices, Trade::MeshIndexData{data.type, Containers::stridedArrayView(indices).exceptPrefix(1).every(2)}, 16}; /* The full index data layout including whatever format should be diff --git a/src/Magnum/MeshTools/Tipsify.cpp b/src/Magnum/MeshTools/Tipsify.cpp index aefe6de5d..d5e9b38da 100644 --- a/src/Magnum/MeshTools/Tipsify.cpp +++ b/src/Magnum/MeshTools/Tipsify.cpp @@ -115,7 +115,7 @@ template void tipsifyInPlaceImplementation(const Containers::StridedArr /* On dead-end */ if(fanningVertex == 0xFFFFFFFFu) { /* Find vertex with live triangles in dead-end stack */ - while(!deadEndStack.empty()) { + while(!deadEndStack.isEmpty()) { UnsignedInt d = deadEndStack.back(); arrayRemoveSuffix(deadEndStack); diff --git a/src/Magnum/Platform/EmscriptenApplication.cpp b/src/Magnum/Platform/EmscriptenApplication.cpp index c7d56de74..fb9095474 100644 --- a/src/Magnum/Platform/EmscriptenApplication.cpp +++ b/src/Magnum/Platform/EmscriptenApplication.cpp @@ -145,7 +145,7 @@ namespace { /* Numpad keys */ } else if(codeView.hasPrefix(numpad)) { - const Containers::StringView numKey = codeView.suffix(numpad.size()); + const Containers::StringView numKey = codeView.exceptPrefix(numpad.size()); if(numKey == "Add"_s) return Key::NumAdd; if(numKey == "Decimal"_s) return Key::NumDecimal; if(numKey == "Divide"_s) return Key::NumDivide; diff --git a/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp b/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp index 3b35dd0fd..0a7748e10 100644 --- a/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp +++ b/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp @@ -36,7 +36,7 @@ namespace Magnum { namespace Primitives { namespace Implementation { WireframeSpheroid::WireframeSpheroid(const UnsignedInt segments): _segments(segments) {} void WireframeSpheroid::bottomHemisphere(const Float endY, const UnsignedInt rings) { - CORRADE_INTERNAL_ASSERT(_vertexData.empty()); + CORRADE_INTERNAL_ASSERT(_vertexData.isEmpty()); /* Initial vertex */ Containers::arrayAppend(_vertexData, diff --git a/src/Magnum/SceneTools/Implementation/convertToSingleFunctionObjects.h b/src/Magnum/SceneTools/Implementation/convertToSingleFunctionObjects.h index 3c0b42dfb..9aaabeaaf 100644 --- a/src/Magnum/SceneTools/Implementation/convertToSingleFunctionObjects.h +++ b/src/Magnum/SceneTools/Implementation/convertToSingleFunctionObjects.h @@ -179,8 +179,8 @@ inline Trade::SceneData convertToSingleFunctionObjects(const Trade::SceneData& s } /* List new objects at the end of the extended parent field */ - const Containers::StridedArrayView1D newParentMapping = outParentMapping.suffix(scene.fieldSize(parentFieldId)); - const Containers::StridedArrayView1D newParents = outParents.suffix(scene.fieldSize(parentFieldId)); + const Containers::StridedArrayView1D newParentMapping = outParentMapping.exceptPrefix(scene.fieldSize(parentFieldId)); + const Containers::StridedArrayView1D newParents = outParents.exceptPrefix(scene.fieldSize(parentFieldId)); for(std::size_t i = 0; i != newParentMapping.size(); ++i) { newParentMapping[i] = newObjectOffset + i; newParents[i] = -1; @@ -221,8 +221,8 @@ inline Trade::SceneData convertToSingleFunctionObjects(const Trade::SceneData& s /* Views to put the mapping to and copy the data to */ const std::size_t newFieldToCopyOffset = scene.fieldSize(*fieldToCopyId); - const Containers::StridedArrayView1D newFieldToCopyMapping = out.mutableMapping(*fieldToCopyId).suffix(newFieldToCopyOffset); - const Containers::StridedArrayView2D newFieldToCopy = out.mutableField(*fieldToCopyId).suffix(newFieldToCopyOffset); + const Containers::StridedArrayView1D newFieldToCopyMapping = out.mutableMapping(*fieldToCopyId).exceptPrefix(newFieldToCopyOffset); + const Containers::StridedArrayView2D newFieldToCopy = out.mutableField(*fieldToCopyId).exceptPrefix(newFieldToCopyOffset); /* As long as there are entries attached to the original objects, copy them */ diff --git a/src/Magnum/SceneTools/Test/FlattenMeshHierarchyTest.cpp b/src/Magnum/SceneTools/Test/FlattenMeshHierarchyTest.cpp index 2b439cf0d..4c504e6e7 100644 --- a/src/Magnum/SceneTools/Test/FlattenMeshHierarchyTest.cpp +++ b/src/Magnum/SceneTools/Test/FlattenMeshHierarchyTest.cpp @@ -173,31 +173,31 @@ void FlattenMeshHierarchyTest::test2D() { Trade::SceneFieldData{Trade::SceneField::Parent, Containers::stridedArrayView(data->parents) .slice(&Data::Parent::object) - .except(instanceData.parentsToExclude), + .exceptSuffix(instanceData.parentsToExclude), Containers::stridedArrayView(data->parents) .slice(&Data::Parent::parent) - .except(instanceData.parentsToExclude)}, + .exceptSuffix(instanceData.parentsToExclude)}, Trade::SceneFieldData{Trade::SceneField::Transformation, Containers::stridedArrayView(data->transforms) .slice(&Data::Transformation::object) - .except(instanceData.transformationsToExclude), + .exceptSuffix(instanceData.transformationsToExclude), Containers::stridedArrayView(data->transforms) .slice(&Data::Transformation::transformation) - .except(instanceData.transformationsToExclude)}, + .exceptSuffix(instanceData.transformationsToExclude)}, Trade::SceneFieldData{Trade::SceneField::Mesh, Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::object) - .suffix(instanceData.meshesToExclude), + .exceptPrefix(instanceData.meshesToExclude), Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::mesh) - .suffix(instanceData.meshesToExclude)}, + .exceptPrefix(instanceData.meshesToExclude)}, Trade::SceneFieldData{Trade::SceneField::MeshMaterial, Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::object) - .suffix(instanceData.meshesToExclude), + .exceptPrefix(instanceData.meshesToExclude), Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::meshMaterial) - .suffix(instanceData.meshesToExclude)}, + .exceptPrefix(instanceData.meshesToExclude)}, }}; Containers::Array> out; @@ -313,31 +313,31 @@ void FlattenMeshHierarchyTest::test3D() { Trade::SceneFieldData{Trade::SceneField::Parent, Containers::stridedArrayView(data->parents) .slice(&Data::Parent::object) - .except(instanceData.parentsToExclude), + .exceptSuffix(instanceData.parentsToExclude), Containers::stridedArrayView(data->parents) .slice(&Data::Parent::parent) - .except(instanceData.parentsToExclude)}, + .exceptSuffix(instanceData.parentsToExclude)}, Trade::SceneFieldData{Trade::SceneField::Transformation, Containers::stridedArrayView(data->transforms) .slice(&Data::Transformation::object) - .except(instanceData.transformationsToExclude), + .exceptSuffix(instanceData.transformationsToExclude), Containers::stridedArrayView(data->transforms) .slice(&Data::Transformation::transformation) - .except(instanceData.transformationsToExclude)}, + .exceptSuffix(instanceData.transformationsToExclude)}, Trade::SceneFieldData{Trade::SceneField::Mesh, Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::object) - .suffix(instanceData.meshesToExclude), + .exceptPrefix(instanceData.meshesToExclude), Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::mesh) - .suffix(instanceData.meshesToExclude)}, + .exceptPrefix(instanceData.meshesToExclude)}, Trade::SceneFieldData{Trade::SceneField::MeshMaterial, Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::object) - .suffix(instanceData.meshesToExclude), + .exceptPrefix(instanceData.meshesToExclude), Containers::stridedArrayView(data->meshes) .slice(&Data::Mesh::meshMaterial) - .suffix(instanceData.meshesToExclude)}, + .exceptPrefix(instanceData.meshesToExclude)}, }}; Containers::Array> out; diff --git a/src/Magnum/ShaderTools/AbstractConverter.cpp b/src/Magnum/ShaderTools/AbstractConverter.cpp index 45c741f77..20d946315 100644 --- a/src/Magnum/ShaderTools/AbstractConverter.cpp +++ b/src/Magnum/ShaderTools/AbstractConverter.cpp @@ -425,7 +425,7 @@ Containers::Array AbstractConverter::linkDataToData(const Containers::Arra "ShaderTools::AbstractConverter::linkDataToData(): feature not supported", {}); CORRADE_ASSERT(!(_flags & ConverterFlag::PreprocessOnly), "ShaderTools::AbstractConverter::linkDataToData(): PreprocessOnly is not allowed in combination with linking", {}); - CORRADE_ASSERT(!data.empty(), + CORRADE_ASSERT(!data.isEmpty(), "ShaderTools::AbstractConverter::linkDataToData(): no data passed", {}); /* Cast to a non-void type for more convenience */ @@ -448,7 +448,7 @@ bool AbstractConverter::linkDataToFile(const Containers::ArrayView AbstractConverter::linkFilesToData(const Containers::Arr "ShaderTools::AbstractConverter::linkFilesToData(): feature not supported", {}); CORRADE_ASSERT(!(_flags & ConverterFlag::PreprocessOnly), "ShaderTools::AbstractConverter::linkFilesToData(): PreprocessOnly is not allowed in combination with linking", {}); - CORRADE_ASSERT(!filenames.empty(), + CORRADE_ASSERT(!filenames.isEmpty(), "ShaderTools::AbstractConverter::linkFilesToData(): no files passed", {}); Containers::Array out; diff --git a/src/Magnum/ShaderTools/Implementation/spirv.h b/src/Magnum/ShaderTools/Implementation/spirv.h index 4f69e9456..46c35655c 100644 --- a/src/Magnum/ShaderTools/Implementation/spirv.h +++ b/src/Magnum/ShaderTools/Implementation/spirv.h @@ -51,7 +51,7 @@ Containers::ArrayView spirvData(const void* code, UnsignedInt const UnsignedInt* const spirv = static_cast(code); /* Not >= 5*4 because just the header alone is useless also */ return size % 4 == 0 && size > 5*4 && spirv[0] == SpvMagicNumber ? - Containers::ArrayView{spirv, size/4}.suffix(5) : nullptr; + Containers::ArrayView{spirv, size/4}.exceptPrefix(5) : nullptr; } /* When an instruction is found, the `data` is advanced after it in order to @@ -61,7 +61,7 @@ Containers::ArrayView spirvFindInstruction(Containers::ArrayV /* Copy the view and iterate that. If we find the instruction, update the passed `data` reference, if not, keep it as it was -- that way, if the find fails, `data` won't become empty and can be used further */ - for(Containers::ArrayView dataIteration = data; !dataIteration.empty(); ) { + for(Containers::ArrayView dataIteration = data; !dataIteration.isEmpty(); ) { const UnsignedInt instructionSize = dataIteration[0] >> 16; const UnsignedInt instructionOp = dataIteration[0] & 0xffff; @@ -75,12 +75,12 @@ Containers::ArrayView spirvFindInstruction(Containers::ArrayV /* This is the instruction we're looking for, return it and update the view to point after it. */ if(instructionOp == op) { - data = dataIteration.suffix(instructionSize); + data = dataIteration.exceptPrefix(instructionSize); return dataIteration.prefix(instructionSize); } /* Otherwise advance the view for next round */ - dataIteration = dataIteration.suffix(instructionSize); + dataIteration = dataIteration.exceptPrefix(instructionSize); } /* Nothing found. Leave the input data as-is. */ @@ -112,7 +112,7 @@ Containers::Optional spirvNextEntrypoint(Containers::ArrayView< Containers::ArrayView interfaces; for(std::size_t i = 3; i != entryPoint.size(); ++i) { if(entryPoint[i] >> 24 == 0) { - interfaces = entryPoint.suffix(i + 1); + interfaces = entryPoint.exceptPrefix(i + 1); break; } } diff --git a/src/Magnum/ShaderTools/Test/SpirvTest.cpp b/src/Magnum/ShaderTools/Test/SpirvTest.cpp index 2384e604f..f74db0cf3 100644 --- a/src/Magnum/ShaderTools/Test/SpirvTest.cpp +++ b/src/Magnum/ShaderTools/Test/SpirvTest.cpp @@ -73,7 +73,7 @@ const struct { /* GCC 4.8 needs the ArrayView conversion explicit */ {"just the header", Containers::arrayView(JustHeader)}, {"invalid magic", Containers::arrayView(InvalidMagic)}, - {"size not divisible by four", Containers::arrayCast(Data).except(1)} + {"size not divisible by four", Containers::arrayCast(Data).exceptSuffix(1)} }; SpirvTest::SpirvTest() { @@ -254,7 +254,7 @@ void SpirvTest::entrypointInterfaceNothing() { Containers::Optional comp = Implementation::spirvNextEntrypoint(view); CORRADE_VERIFY(comp); - CORRADE_VERIFY(comp->interfaces.empty()); + CORRADE_VERIFY(comp->interfaces.isEmpty()); Implementation::spirvEntrypointInterface(view, *comp, {}); diff --git a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp index acbe7f4bf..a33a9386d 100644 --- a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp +++ b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp @@ -126,8 +126,8 @@ template DistanceFieldVectorGL::DistanceFiel vert.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - vert.addSource(rs.get("generic.glsl")) - .addSource(rs.get("Vector.vert")); + vert.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("Vector.vert")); #ifndef MAGNUM_TARGET_GLES2 if(flags >= Flag::UniformBuffers) { frag.addSource(Utility::formatString( @@ -139,8 +139,8 @@ template DistanceFieldVectorGL::DistanceFiel frag.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - frag.addSource(rs.get("generic.glsl")) - .addSource(rs.get("DistanceFieldVector.frag")); + frag.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("DistanceFieldVector.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(GL::Shader::compile({vert, frag})); diff --git a/src/Magnum/Shaders/FlatGL.cpp b/src/Magnum/Shaders/FlatGL.cpp index 82af03e2b..86504acad 100644 --- a/src/Magnum/Shaders/FlatGL.cpp +++ b/src/Magnum/Shaders/FlatGL.cpp @@ -167,8 +167,8 @@ template FlatGL::FlatGL(const Flags flags vert.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - vert.addSource(rs.get("generic.glsl")) - .addSource(rs.get("Flat.vert")); + vert.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("Flat.vert")); frag.addSource(flags & Flag::Textured ? "#define TEXTURED\n" : "") #ifndef MAGNUM_TARGET_GLES2 .addSource(flags & Flag::TextureArrays ? "#define TEXTURE_ARRAYS\n" : "") @@ -192,8 +192,8 @@ template FlatGL::FlatGL(const Flags flags frag.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - frag.addSource(rs.get("generic.glsl")) - .addSource(rs.get("Flat.frag")); + frag.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("Flat.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(GL::Shader::compile({vert, frag})); diff --git a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h index 1d0e2cac8..d8e82ab73 100644 --- a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h +++ b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h @@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE. */ +#include /** @todo remove when Shader is -free */ +#include #include #include "Magnum/GL/Context.h" @@ -65,7 +67,7 @@ inline GL::Shader createCompatibilityShader(const Utility::Resource& rs, GL::Ver shader.addSource("#ifndef GL_ES\n#define GL_ES 1\n#endif\n"); #endif - shader.addSource(rs.get("compatibility.glsl")); + shader.addSource(rs.getString("compatibility.glsl")); return shader; } diff --git a/src/Magnum/Shaders/MeshVisualizerGL.cpp b/src/Magnum/Shaders/MeshVisualizerGL.cpp index 5233b5ae7..615231aa5 100644 --- a/src/Magnum/Shaders/MeshVisualizerGL.cpp +++ b/src/Magnum/Shaders/MeshVisualizerGL.cpp @@ -424,8 +424,8 @@ MeshVisualizerGL2D::MeshVisualizerGL2D(const Flags flags the shader code */ .addSource((flags & Flag::NoGeometryShader) || !(flags & Flag::Wireframe) ? "#define NO_GEOMETRY_SHADER\n" : "") - .addSource(rs.get("generic.glsl")) - .addSource(rs.get("MeshVisualizer.vert")); + .addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("MeshVisualizer.vert")); frag /* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when nothing actually needs it, as that makes checks much simpler in @@ -436,8 +436,8 @@ MeshVisualizerGL2D::MeshVisualizerGL2D(const Flags flags if(flags >= Flag::UniformBuffers) frag.addSource("#define TWO_DIMENSIONS\n"); #endif - frag.addSource(rs.get("generic.glsl")) - .addSource(rs.get("MeshVisualizer.frag")); + frag.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("MeshVisualizer.frag")); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Containers::Optional geom; @@ -466,7 +466,7 @@ MeshVisualizerGL2D::MeshVisualizerGL2D(const Flags flags geom->addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - geom->addSource(rs.get("MeshVisualizer.geom")); + geom->addSource(rs.getString("MeshVisualizer.geom")); } #else static_cast(version); @@ -745,8 +745,8 @@ MeshVisualizerGL3D::MeshVisualizerGL3D(const Flags flags .addSource(flags & Flag::NormalDirection ? "#define NORMAL_DIRECTION\n" : "") #endif ; - vert.addSource(rs.get("generic.glsl")) - .addSource(rs.get("MeshVisualizer.vert")); + vert.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("MeshVisualizer.vert")); frag /* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when nothing actually needs it, as that makes checks much simpler in @@ -764,8 +764,8 @@ MeshVisualizerGL3D::MeshVisualizerGL3D(const Flags flags if(flags >= Flag::UniformBuffers) frag.addSource("#define THREE_DIMENSIONS\n"); #endif - frag.addSource(rs.get("generic.glsl")) - .addSource(rs.get("MeshVisualizer.frag")); + frag.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("MeshVisualizer.frag")); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Containers::Optional geom; @@ -805,7 +805,7 @@ MeshVisualizerGL3D::MeshVisualizerGL3D(const Flags flags geom->addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - geom->addSource(rs.get("MeshVisualizer.geom")); + geom->addSource(rs.getString("MeshVisualizer.geom")); } #else static_cast(version); diff --git a/src/Magnum/Shaders/PhongGL.cpp b/src/Magnum/Shaders/PhongGL.cpp index 2269bb81f..a23561463 100644 --- a/src/Magnum/Shaders/PhongGL.cpp +++ b/src/Magnum/Shaders/PhongGL.cpp @@ -243,8 +243,8 @@ PhongGL::PhongGL(const Flags flags, const UnsignedInt lightCount vert.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - vert.addSource(rs.get("generic.glsl")) - .addSource(rs.get("Phong.vert")); + vert.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("Phong.vert")); frag.addSource(flags & Flag::AmbientTexture ? "#define AMBIENT_TEXTURE\n" : "") .addSource(flags & Flag::DiffuseTexture ? "#define DIFFUSE_TEXTURE\n" : "") .addSource(flags & Flag::SpecularTexture ? "#define SPECULAR_TEXTURE\n" : "") @@ -291,8 +291,8 @@ PhongGL::PhongGL(const Flags flags, const UnsignedInt lightCount if(!(flags >= Flag::UniformBuffers) && lightCount) frag.addSource(std::move(lightInitializer)); #endif - frag.addSource(rs.get("generic.glsl")) - .addSource(rs.get("Phong.frag")); + frag.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("Phong.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(GL::Shader::compile({vert, frag})); diff --git a/src/Magnum/Shaders/VectorGL.cpp b/src/Magnum/Shaders/VectorGL.cpp index 177bf13f3..addcb7433 100644 --- a/src/Magnum/Shaders/VectorGL.cpp +++ b/src/Magnum/Shaders/VectorGL.cpp @@ -125,8 +125,8 @@ template VectorGL::VectorGL(const Flags flag vert.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - vert.addSource(rs.get("generic.glsl")) - .addSource(rs.get("Vector.vert")); + vert.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("Vector.vert")); #ifndef MAGNUM_TARGET_GLES2 if(flags >= Flag::UniformBuffers) { frag.addSource(Utility::formatString( @@ -138,8 +138,8 @@ template VectorGL::VectorGL(const Flags flag frag.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - frag.addSource(rs.get("generic.glsl")) - .addSource(rs.get("Vector.frag")); + frag.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("Vector.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(GL::Shader::compile({vert, frag})); diff --git a/src/Magnum/Shaders/VertexColorGL.cpp b/src/Magnum/Shaders/VertexColorGL.cpp index 711ded7f4..31d6e4821 100644 --- a/src/Magnum/Shaders/VertexColorGL.cpp +++ b/src/Magnum/Shaders/VertexColorGL.cpp @@ -116,10 +116,10 @@ template VertexColorGL::VertexColorGL(const vert.addSource(flags >= Flag::MultiDraw ? "#define MULTI_DRAW\n" : ""); } #endif - vert.addSource(rs.get("generic.glsl")) - .addSource(rs.get("VertexColor.vert")); - frag.addSource(rs.get("generic.glsl")) - .addSource(rs.get("VertexColor.frag")); + vert.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("VertexColor.vert")); + frag.addSource(rs.getString("generic.glsl")) + .addSource(rs.getString("VertexColor.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(GL::Shader::compile({vert, frag})); diff --git a/src/Magnum/TextureTools/DistanceField.cpp b/src/Magnum/TextureTools/DistanceField.cpp index fc0d3055d..42abeab61 100644 --- a/src/Magnum/TextureTools/DistanceField.cpp +++ b/src/Magnum/TextureTools/DistanceField.cpp @@ -99,10 +99,10 @@ DistanceFieldShader::DistanceFieldShader(const UnsignedInt radius) { GL::Shader vert = Shaders::Implementation::createCompatibilityShader(rs, v, GL::Shader::Type::Vertex); GL::Shader frag = Shaders::Implementation::createCompatibilityShader(rs, v, GL::Shader::Type::Fragment); - vert.addSource(rs.get("FullScreenTriangle.glsl")) - .addSource(rs.get("DistanceFieldShader.vert")); + vert.addSource(rs.getString("FullScreenTriangle.glsl")) + .addSource(rs.getString("DistanceFieldShader.vert")); frag.addSource(Utility::formatString("#define RADIUS {}\n", radius)) - .addSource(rs.get("DistanceFieldShader.frag")); + .addSource(rs.getString("DistanceFieldShader.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(GL::Shader::compile({vert, frag})); diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index 89eba4043..01602953e 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -439,7 +439,7 @@ Containers::Array AbstractImageConverter::convertToData(const ImageData3D& namespace { template bool checkImageValidity(const char* const messagePrefix, const Containers::ArrayView> imageLevels) { - CORRADE_ASSERT(!imageLevels.empty(), + CORRADE_ASSERT(!imageLevels.isEmpty(), messagePrefix << "at least one image has to be specified", false); const PixelFormat format = imageLevels[0].format(); @@ -462,7 +462,7 @@ template bool checkImageValidity(const char* const messa } template bool checkImageValidity(const char* const messagePrefix, const Containers::ArrayView> imageLevels) { - CORRADE_ASSERT(!imageLevels.empty(), + CORRADE_ASSERT(!imageLevels.isEmpty(), messagePrefix << "at least one image has to be specified", false); const CompressedPixelFormat format = imageLevels[0].format(); diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 5de52545d..95529a715 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -562,7 +562,7 @@ void AbstractImporter::populateCachedScenes() { Not ideal, especially regarding the 3D assumption, but better than nothing. */ - if(!_cachedScenes->scenes.empty() && !_cachedScenes->object2DCount && !_cachedScenes->object3DCount) + if(!_cachedScenes->scenes.isEmpty() && !_cachedScenes->object2DCount && !_cachedScenes->object3DCount) _cachedScenes->object3DCount = objectCount(); } @@ -698,12 +698,12 @@ Containers::Pointer AbstractImporter::doObject2D(const UnsignedInt in which order we decide on the legacy object type. */ CORRADE_INTERNAL_ASSERT(camera.size() + mesh.size() <= 1); - if(!mesh.empty()) { + if(!mesh.isEmpty()) { return Containers::pointer(flags & ObjectFlag2D::HasTranslationRotationScaling ? new MeshObjectData2D{std::move(children), trs->first(), trs->second(), trs->third(), mesh.front().first(), mesh.front().second(), - skin.empty() ? -1 : Int(skin.front()), + skin.isEmpty() ? -1 : Int(skin.front()), importerState ? *importerState : nullptr} : new MeshObjectData2D{std::move(children), *transformation, @@ -877,12 +877,12 @@ Containers::Pointer AbstractImporter::doObject3D(const UnsignedInt doesn't matter in which order we decide on the legacy object type. */ CORRADE_INTERNAL_ASSERT(camera.size() + light.size() + mesh.size() <= 1); - if(!mesh.empty()) { + if(!mesh.isEmpty()) { return Containers::pointer(flags & ObjectFlag3D::HasTranslationRotationScaling ? new MeshObjectData3D{std::move(children), trs->first(), trs->second(), trs->third(), mesh.front().first(), mesh.front().second(), - skin.empty() ? -1 : Int(skin.front()), + skin.isEmpty() ? -1 : Int(skin.front()), importerState ? *importerState : nullptr} : new MeshObjectData3D{std::move(children), *transformation, diff --git a/src/Magnum/Trade/AnimationData.cpp b/src/Magnum/Trade/AnimationData.cpp index 51a7065ec..7ebbaaf38 100644 --- a/src/Magnum/Trade/AnimationData.cpp +++ b/src/Magnum/Trade/AnimationData.cpp @@ -46,7 +46,7 @@ AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayV AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayView data, std::initializer_list tracks, const Range1D& duration, const void* importerState): AnimationData{dataFlags, data, Implementation::initializerListToArrayWithDefaultDeleter(tracks), duration, importerState} {} AnimationData::AnimationData(Containers::Array&& data, Containers::Array&& tracks, const void* importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _data{std::move(data)}, _tracks{std::move(tracks)}, _importerState{importerState} { - if(!_tracks.empty()) { + if(!_tracks.isEmpty()) { /* Reset duration to duration of the first track so it properly support cases where tracks don't start at 0 */ _duration = _tracks.front()._view.duration(); diff --git a/src/Magnum/Trade/MaterialData.cpp b/src/Magnum/Trade/MaterialData.cpp index 5ea2b12fd..2ff6b320a 100644 --- a/src/Magnum/Trade/MaterialData.cpp +++ b/src/Magnum/Trade/MaterialData.cpp @@ -958,7 +958,7 @@ Debug& operator<<(Debug& debug, const MaterialAttribute value) { /* LayerName is prefixed with a single space, drop that */ Containers::StringView string = AttributeMap[UnsignedInt(value) - 1].name; - if(string[0] == ' ') string = string.suffix(1); + if(string[0] == ' ') string = string.exceptPrefix(1); return debug << "::" << Debug::nospace << string; } diff --git a/src/Magnum/Trade/MaterialData.h b/src/Magnum/Trade/MaterialData.h index e314651fe..0ef7d113a 100644 --- a/src/Magnum/Trade/MaterialData.h +++ b/src/Magnum/Trade/MaterialData.h @@ -1886,7 +1886,7 @@ class MAGNUM_TRADE_EXPORT MaterialData { * at least @cpp 1 @ce. */ UnsignedInt layerCount() const { - return _layerOffsets.empty() ? 1 : _layerOffsets.size(); + return _layerOffsets.isEmpty() ? 1 : _layerOffsets.size(); } /** diff --git a/src/Magnum/Trade/MeshData.cpp b/src/Magnum/Trade/MeshData.cpp index 7d1c71f4b..eecfb844f 100644 --- a/src/Magnum/Trade/MeshData.cpp +++ b/src/Magnum/Trade/MeshData.cpp @@ -69,9 +69,9 @@ MeshAttributeData::MeshAttributeData(const MeshAttribute name, const VertexForma because I feel that makes more sense than duplicating the full assert logic */ #ifndef CORRADE_NO_ASSERT - if(arraySize) CORRADE_ASSERT(data.empty()[0] || isVertexFormatImplementationSpecific(format) || data.size()[1] == vertexFormatSize(format)*arraySize, + if(arraySize) CORRADE_ASSERT(data.isEmpty()[0] || isVertexFormatImplementationSpecific(format) || data.size()[1] == vertexFormatSize(format)*arraySize, "Trade::MeshAttributeData: second view dimension size" << data.size()[1] << "doesn't match" << format << "and array size" << arraySize, ); - else CORRADE_ASSERT(data.empty()[0] || isVertexFormatImplementationSpecific(format) || data.size()[1] == vertexFormatSize(format), + else CORRADE_ASSERT(data.isEmpty()[0] || isVertexFormatImplementationSpecific(format) || data.size()[1] == vertexFormatSize(format), "Trade::MeshAttributeData: second view dimension size" << data.size()[1] << "doesn't match" << format, ); #endif CORRADE_ASSERT(data.isContiguous<1>(), @@ -106,7 +106,7 @@ MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& inde #ifndef CORRADE_NO_ASSERT UnsignedInt expectedAttributeVertexCount; #endif - if(_attributes.empty()) { + if(_attributes.isEmpty()) { CORRADE_ASSERT(vertexCount != ImplicitVertexCount, "Trade::MeshData: vertex count can't be implicit if there are no attributes", ); _vertexCount = vertexCount; @@ -131,7 +131,7 @@ MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& inde } #ifndef CORRADE_NO_ASSERT - CORRADE_ASSERT(_indexCount || _indexData.empty(), + CORRADE_ASSERT(_indexCount || _indexData.isEmpty(), "Trade::MeshData: indexData passed for a non-indexed mesh", ); if(_indexCount) { const UnsignedInt typeSize = @@ -687,11 +687,11 @@ void MeshData::bitangentSignsInto(const Containers::StridedArrayView1D& d if(attribute._format == VertexFormat::Vector4) Utility::copy(Containers::arrayCast<2, const Float>(attributeData, 4).transposed<0, 1>()[3], destination); else if(attribute._format == VertexFormat::Vector4h) - Math::unpackHalfInto(Containers::arrayCast<2, const UnsignedShort>(attributeData, 4).suffix({0, 3}), destination1f); + Math::unpackHalfInto(Containers::arrayCast<2, const UnsignedShort>(attributeData, 4).exceptPrefix({0, 3}), destination1f); else if(attribute._format == VertexFormat::Vector4bNormalized) - Math::unpackInto(Containers::arrayCast<2, const Byte>(attributeData, 4).suffix({0, 3}), destination1f); + Math::unpackInto(Containers::arrayCast<2, const Byte>(attributeData, 4).exceptPrefix({0, 3}), destination1f); else if(attribute._format == VertexFormat::Vector4sNormalized) - Math::unpackInto(Containers::arrayCast<2, const Short>(attributeData, 4).suffix({0, 3}), destination1f); + Math::unpackInto(Containers::arrayCast<2, const Short>(attributeData, 4).exceptPrefix({0, 3}), destination1f); else CORRADE_ASSERT_UNREACHABLE("Trade::MeshData::bitangentSignsInto(): expected four-component tangents, but got" << attribute._format, ); } diff --git a/src/Magnum/Trade/SceneData.cpp b/src/Magnum/Trade/SceneData.cpp index 1415d1cc7..29b78dc8c 100644 --- a/src/Magnum/Trade/SceneData.cpp +++ b/src/Magnum/Trade/SceneData.cpp @@ -506,9 +506,9 @@ SceneFieldData::SceneFieldData(const SceneField name, const Containers::StridedA because I feel that makes more sense than duplicating the full assert logic */ #ifndef CORRADE_NO_ASSERT - if(fieldArraySize) CORRADE_ASSERT(fieldData.empty()[0] || fieldData.size()[1] == sceneFieldTypeSize(fieldType)*fieldArraySize, + if(fieldArraySize) CORRADE_ASSERT(fieldData.isEmpty()[0] || fieldData.size()[1] == sceneFieldTypeSize(fieldType)*fieldArraySize, "Trade::SceneFieldData: second field view dimension size" << fieldData.size()[1] << "doesn't match" << fieldType << "and field array size" << fieldArraySize, ); - else CORRADE_ASSERT(fieldData.empty()[0] || fieldData.size()[1] == sceneFieldTypeSize(fieldType), + else CORRADE_ASSERT(fieldData.isEmpty()[0] || fieldData.size()[1] == sceneFieldTypeSize(fieldType), "Trade::SceneFieldData: second field view dimension size" << fieldData.size()[1] << "doesn't match" << fieldType, ); #endif @@ -779,7 +779,7 @@ SceneData::SceneData(std::vector children2D, std::vector().flags(), Containers::StringViewFlag::NullTerminated); CORRADE_COMPARE(attribute.value()[attribute.value().size()], '\0'); - constexpr MaterialAttributeData cattribute{"name that's long"_s, "and a value\0that's also long but still fits!!"_s.except(1)}; + constexpr MaterialAttributeData cattribute{"name that's long"_s, "and a value\0that's also long but still fits!!"_s.exceptSuffix(1)}; CORRADE_COMPARE(cattribute.name(), "name that's long"); CORRADE_COMPARE(cattribute.name().flags(), Containers::StringViewFlag::NullTerminated); CORRADE_COMPARE(cattribute.name()[cattribute.name().size()], '\0'); @@ -591,7 +591,7 @@ void MaterialDataTest::constructAttributeStringNameStringValue() { CORRADE_COMPARE(cattribute.value()[cattribute.value().size()], '\0'); /* Type-erased variant */ - const Containers::StringView value = "and a value\0that's also long but still fits!!"_s.except(1); + const Containers::StringView value = "and a value\0that's also long but still fits!!"_s.exceptSuffix(1); MaterialAttributeData typeErased{"name that's long", MaterialAttributeType::String, &value}; CORRADE_COMPARE(typeErased.name(), "name that's long"); CORRADE_COMPARE(typeErased.name().flags(), Containers::StringViewFlag::NullTerminated); @@ -606,7 +606,7 @@ void MaterialDataTest::constructAttributeNameStringValue() { /* Explicitly using a non-null-terminated view on input to check the null byte isn't read by accident*/ - MaterialAttributeData attribute{MaterialAttribute::LayerName, "a value\0that's long but still fits!!"_s.except(1)}; + MaterialAttributeData attribute{MaterialAttribute::LayerName, "a value\0that's long but still fits!!"_s.exceptSuffix(1)}; CORRADE_COMPARE(attribute.name(), " LayerName"); CORRADE_COMPARE(attribute.name().flags(), Containers::StringViewFlag::NullTerminated); CORRADE_COMPARE(attribute.name()[attribute.name().size()], '\0'); @@ -618,7 +618,7 @@ void MaterialDataTest::constructAttributeNameStringValue() { CORRADE_COMPARE(attribute.value()[attribute.value().size()], '\0'); /* Type-erased variant */ - const Containers::StringView value = "a value\0that's long but still fits!!"_s.except(1); + const Containers::StringView value = "a value\0that's long but still fits!!"_s.exceptSuffix(1); MaterialAttributeData typeErased{MaterialAttribute::LayerName, MaterialAttributeType::String, &value}; CORRADE_COMPARE(typeErased.name(), " LayerName"); CORRADE_COMPARE(typeErased.name().flags(), Containers::StringViewFlag::NullTerminated); diff --git a/src/Magnum/Trade/Test/MeshDataTest.cpp b/src/Magnum/Trade/Test/MeshDataTest.cpp index 00693e0f0..12f0d6e58 100644 --- a/src/Magnum/Trade/Test/MeshDataTest.cpp +++ b/src/Magnum/Trade/Test/MeshDataTest.cpp @@ -1255,7 +1255,7 @@ void MeshDataTest::construct() { CORRADE_COMPARE(data.indexDataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(data.vertexDataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(data.primitive(), MeshPrimitive::Triangles); - CORRADE_VERIFY(!data.attributeData().empty()); + CORRADE_VERIFY(!data.attributeData().isEmpty()); CORRADE_COMPARE(static_cast(data.indexData() + 2), indexView.data()); CORRADE_COMPARE(static_cast(data.vertexData()), vertexView.data()); CORRADE_COMPARE(static_cast(data.mutableIndexData() + 2), indexView.data()); @@ -2112,7 +2112,7 @@ void MeshDataTest::constructSpecialAttributeStrides() { MeshData mesh{MeshPrimitive::Points, std::move(vertexData), { MeshAttributeData{MeshAttribute::ObjectId, vertices.prefix(1).broadcasted<0>(4)}, - MeshAttributeData{MeshAttribute::ObjectId, vertices.suffix(1).flipped<0>()}, + MeshAttributeData{MeshAttribute::ObjectId, vertices.exceptPrefix(1).flipped<0>()}, }}; CORRADE_COMPARE(mesh.attributeStride(0), 0); @@ -2168,7 +2168,7 @@ void MeshDataTest::constructSpecialAttributeStridesImplementationSpecificVertexF MeshData mesh{MeshPrimitive::Points, std::move(vertexData), { MeshAttributeData{MeshAttribute::ObjectId, vertexFormatWrap(0xdead), vertices.prefix(1).broadcasted<0>(4)}, - MeshAttributeData{MeshAttribute::ObjectId, vertexFormatWrap(0xdead), vertices.suffix(1).flipped<0>()} + MeshAttributeData{MeshAttribute::ObjectId, vertexFormatWrap(0xdead), vertices.exceptPrefix(1).flipped<0>()} }}; CORRADE_COMPARE(mesh.attributeStride(0), 0); diff --git a/src/Magnum/Trade/Test/SceneDataTest.cpp b/src/Magnum/Trade/Test/SceneDataTest.cpp index e540f7c0c..f5aaea932 100644 --- a/src/Magnum/Trade/Test/SceneDataTest.cpp +++ b/src/Magnum/Trade/Test/SceneDataTest.cpp @@ -1348,7 +1348,7 @@ void SceneDataTest::construct() { /* Basics */ CORRADE_COMPARE(scene.dataFlags(), DataFlag::Owned|DataFlag::Mutable); - CORRADE_VERIFY(!scene.fieldData().empty()); + CORRADE_VERIFY(!scene.fieldData().isEmpty()); CORRADE_COMPARE(static_cast(scene.data()), transformsParentFieldMappingData.data()); CORRADE_COMPARE(static_cast(scene.mutableData()), transformsParentFieldMappingData.data()); CORRADE_COMPARE(scene.mappingBound(), 8); @@ -1588,7 +1588,7 @@ void SceneDataTest::constructZeroFields() { int importerState{}; SceneData scene{SceneMappingType::UnsignedShort, 37563, nullptr, {}, &importerState}; CORRADE_COMPARE(scene.dataFlags(), DataFlag::Owned|DataFlag::Mutable); - CORRADE_VERIFY(scene.fieldData().empty()); + CORRADE_VERIFY(scene.fieldData().isEmpty()); CORRADE_COMPARE(static_cast(scene.data()), nullptr); CORRADE_COMPARE(static_cast(scene.mutableData()), nullptr); CORRADE_COMPARE(scene.importerState(), &importerState); @@ -1606,7 +1606,7 @@ void SceneDataTest::constructZeroObjects() { SceneFieldData materials{SceneField::MeshMaterial, SceneMappingType::UnsignedInt, nullptr, SceneFieldType::Int, nullptr}; SceneData scene{SceneMappingType::UnsignedInt, 0, nullptr, {meshes, materials}, &importerState}; CORRADE_COMPARE(scene.dataFlags(), DataFlag::Owned|DataFlag::Mutable); - CORRADE_VERIFY(!scene.fieldData().empty()); + CORRADE_VERIFY(!scene.fieldData().isEmpty()); CORRADE_COMPARE(static_cast(scene.data()), nullptr); CORRADE_COMPARE(static_cast(scene.mutableData()), nullptr); CORRADE_COMPARE(scene.importerState(), &importerState); @@ -1996,8 +1996,8 @@ void SceneDataTest::constructMismatchedTRSViews() { SceneFieldData translations{SceneField::Translation, translationMappingData, translationFieldData}; SceneFieldData rotationsDifferent{SceneField::Rotation, rotationMappingData, rotationFieldData}; SceneFieldData scalingsDifferent{SceneField::Scaling, scalingMappingData, scalingFieldData}; - SceneFieldData rotationsSameButLess{SceneField::Rotation, translationMappingData.except(1), rotationFieldData.except(1)}; - SceneFieldData scalingsSameButLess{SceneField::Scaling, translationMappingData.except(2), scalingFieldData.except(2)}; + SceneFieldData rotationsSameButLess{SceneField::Rotation, translationMappingData.exceptSuffix(1), rotationFieldData.exceptSuffix(1)}; + SceneFieldData scalingsSameButLess{SceneField::Scaling, translationMappingData.exceptSuffix(2), scalingFieldData.exceptSuffix(2)}; /* Test that all pairs get checked */ std::ostringstream out; @@ -2162,7 +2162,7 @@ void SceneDataTest::constructMismatchedMeshMaterialView() { SceneFieldData meshes{SceneField::Mesh, meshMappingData, meshFieldData}; SceneFieldData meshMaterialsDifferent{SceneField::MeshMaterial, meshMaterialMappingData, meshMaterialFieldData}; - SceneFieldData meshMaterialsSameButLess{SceneField::MeshMaterial, meshMappingData.except(1), meshMaterialFieldData.except(1)}; + SceneFieldData meshMaterialsSameButLess{SceneField::MeshMaterial, meshMappingData.exceptSuffix(1), meshMaterialFieldData.exceptSuffix(1)}; std::ostringstream out; Error redirectError{&out}; diff --git a/src/Magnum/Trade/imageconverter.cpp b/src/Magnum/Trade/imageconverter.cpp index 2c343b832..76ef2b2a8 100644 --- a/src/Magnum/Trade/imageconverter.cpp +++ b/src/Magnum/Trade/imageconverter.cpp @@ -199,7 +199,7 @@ using namespace Magnum; namespace { template bool checkCommonFormat(const Utility::Arguments& args, const Containers::Array>& images) { - CORRADE_INTERNAL_ASSERT(!images.empty()); + CORRADE_INTERNAL_ASSERT(!images.isEmpty()); const bool compressed = images.front().isCompressed(); PixelFormat format{}; CompressedPixelFormat compressedFormat{}; @@ -231,7 +231,7 @@ template bool checkCommonFormat(const Utility::Arguments template bool checkCommonFormatAndSize(const Utility::Arguments& args, const Containers::Array>& images) { if(!checkCommonFormat(args, images)) return false; - CORRADE_INTERNAL_ASSERT(!images.empty()); + CORRADE_INTERNAL_ASSERT(!images.isEmpty()); Math::Vector size = images.front().size(); for(std::size_t i = 1; i != images.size(); ++i) { if(images[i].size() != size) { @@ -258,7 +258,7 @@ template bool convertOneOrMoreImages(Trade::AbstractImag if(outputImages.size() == 1) return converter.convertToFile(outputImages.front(), output); - CORRADE_INTERNAL_ASSERT(!outputImages.empty()); + CORRADE_INTERNAL_ASSERT(!outputImages.isEmpty()); if(outputImages.front().isCompressed()) return convertOneOrMoreImages(converter, outputImages, output); else diff --git a/src/Magnum/Vk/DescriptorPool.cpp b/src/Magnum/Vk/DescriptorPool.cpp index bac994f23..27d94a963 100644 --- a/src/Magnum/Vk/DescriptorPool.cpp +++ b/src/Magnum/Vk/DescriptorPool.cpp @@ -43,7 +43,7 @@ DescriptorPoolCreateInfo::DescriptorPoolCreateInfo(const UnsignedInt maxSets, co /* On certain compilers, {} (empty initializer list) gets converted to an arrayview that's not null, interesting. Explicitly using .empty() to ensure the assert gets properly fired. */ - CORRADE_ASSERT(!poolSizes.empty(), + CORRADE_ASSERT(!poolSizes.isEmpty(), "Vk::DescriptorPoolCreateInfo: there has to be at least one pool", ); Containers::ArrayView poolSizesCopy; diff --git a/src/Magnum/Vk/Device.cpp b/src/Magnum/Vk/Device.cpp index 3016d4205..9f80a2aff 100644 --- a/src/Magnum/Vk/Device.cpp +++ b/src/Magnum/Vk/Device.cpp @@ -290,7 +290,7 @@ DeviceCreateInfo& DeviceCreateInfo::operator=(DeviceCreateInfo&& other) noexcept } DeviceCreateInfo& DeviceCreateInfo::addEnabledExtensions(const Containers::ArrayView extensions) & { - if(extensions.empty()) return *this; + if(extensions.isEmpty()) return *this; /* This can happen in case we used the NoInit or VkDeviceCreateInfo constructor */ if(!_state) _state.emplace(); @@ -334,7 +334,7 @@ DeviceCreateInfo&& DeviceCreateInfo::addEnabledExtensions(const std::initializer } DeviceCreateInfo& DeviceCreateInfo::addEnabledExtensions(const Containers::ArrayView extensions) & { - if(extensions.empty()) return *this; + if(extensions.isEmpty()) return *this; /* This can happen in case we used the NoInit or VkDeviceCreateInfo constructor */ if(!_state) _state.emplace(); @@ -575,7 +575,7 @@ DeviceCreateInfo&& DeviceCreateInfo::setEnabledFeatures(const DeviceFeatures& fe } DeviceCreateInfo& DeviceCreateInfo::addQueues(const UnsignedInt family, const Containers::ArrayView priorities, const Containers::ArrayView> output) & { - CORRADE_ASSERT(!priorities.empty(), "Vk::DeviceCreateInfo::addQueues(): at least one queue priority has to be specified", *this); + CORRADE_ASSERT(!priorities.isEmpty(), "Vk::DeviceCreateInfo::addQueues(): at least one queue priority has to be specified", *this); CORRADE_ASSERT(output.size() == priorities.size(), "Vk::DeviceCreateInfo::addQueues(): expected" << priorities.size() << "outuput queue references but got" << output.size(), *this); /* This can happen in case we used the NoInit or VkDeviceCreateInfo @@ -594,7 +594,7 @@ DeviceCreateInfo& DeviceCreateInfo::addQueues(const UnsignedInt family, const Co this grows too big as all pointers would need to be patched, so there's a static limit. */ CORRADE_INTERNAL_ASSERT(_state->nextQueuePriority + priorities.size() <= _state->queuePriorities.size()); - Utility::copy(priorities, _state->queuePriorities.suffix(_state->nextQueuePriority).prefix(priorities.size())); + Utility::copy(priorities, _state->queuePriorities.exceptPrefix(_state->nextQueuePriority).prefix(priorities.size())); for(std::size_t i = 0; i != priorities.size(); ++i) _state->queueOutput[_state->nextQueuePriority + i] = &*output[i]; _state->nextQueuePriority += priorities.size(); diff --git a/src/Magnum/Vk/DeviceProperties.cpp b/src/Magnum/Vk/DeviceProperties.cpp index f42181470..6af161cfc 100644 --- a/src/Magnum/Vk/DeviceProperties.cpp +++ b/src/Magnum/Vk/DeviceProperties.cpp @@ -375,7 +375,7 @@ Containers::ArrayView DeviceProperties::queueFam if(!_state) _state.emplace(*_instance, _handle); /* Fetch if not already */ - if(_state->queueFamilyProperties.empty()) { + if(_state->queueFamilyProperties.isEmpty()) { UnsignedInt count; _state->getQueueFamilyPropertiesImplementation(*this, count, nullptr); diff --git a/src/Magnum/Vk/Instance.cpp b/src/Magnum/Vk/Instance.cpp index 32f985832..0e63059f4 100644 --- a/src/Magnum/Vk/Instance.cpp +++ b/src/Magnum/Vk/Instance.cpp @@ -174,7 +174,7 @@ InstanceCreateInfo& InstanceCreateInfo::setApplicationInfo(const Containers::Str } InstanceCreateInfo& InstanceCreateInfo::addEnabledLayers(const Containers::ArrayView layers) { - if(layers.empty()) return *this; + if(layers.isEmpty()) return *this; if(!_state) _state.emplace(); /* Add null-terminated strings to the layer array */ @@ -208,7 +208,7 @@ InstanceCreateInfo& InstanceCreateInfo::addEnabledLayers(const std::initializer_ } InstanceCreateInfo& InstanceCreateInfo::addEnabledExtensions(const Containers::ArrayView extensions) { - if(extensions.empty()) return *this; + if(extensions.isEmpty()) return *this; if(!_state) _state.emplace(); /* Add null-terminated strings to the extension array */ @@ -242,7 +242,7 @@ InstanceCreateInfo& InstanceCreateInfo::addEnabledExtensions(const std::initiali } InstanceCreateInfo& InstanceCreateInfo::addEnabledExtensions(const Containers::ArrayView extensions) { - if(extensions.empty()) return *this; + if(extensions.isEmpty()) return *this; if(!_state) _state.emplace(); arrayReserve(_state->extensions, _state->extensions.size() + extensions.size()); diff --git a/src/Magnum/Vk/MeshLayout.cpp b/src/Magnum/Vk/MeshLayout.cpp index c698b2fb7..0df6fbb16 100644 --- a/src/Magnum/Vk/MeshLayout.cpp +++ b/src/Magnum/Vk/MeshLayout.cpp @@ -177,7 +177,7 @@ MeshLayout& MeshLayout::addBinding(const UnsignedInt binding, const UnsignedInt if(!_state) _state.emplace(); /* Ensure order for efficient comparisons */ - CORRADE_ASSERT(_state->bindings.empty() || _state->bindings.back().binding < binding, + CORRADE_ASSERT(_state->bindings.isEmpty() || _state->bindings.back().binding < binding, "Vk::MeshLayout::addBinding(): binding" << binding << "can't be ordered after" << _state->bindings.back().binding, *this); VkVertexInputBindingDescription description{}; @@ -199,7 +199,7 @@ MeshLayout& MeshLayout::addInstancedBinding(const UnsignedInt binding, const Uns if(!_state) _state.emplace(); /* Ensure order for efficient comparisons */ - CORRADE_ASSERT(_state->bindings.empty() || _state->bindings.back().binding < binding, + CORRADE_ASSERT(_state->bindings.isEmpty() || _state->bindings.back().binding < binding, "Vk::MeshLayout::addInstancedBinding(): binding" << binding << "can't be ordered after" << _state->bindings.back().binding, *this); VkVertexInputBindingDescription description{}; @@ -234,7 +234,7 @@ MeshLayout& MeshLayout::addAttribute(const UnsignedInt location, const UnsignedI if(!_state) _state.emplace(); /* Ensure order for efficient comparisons */ - CORRADE_ASSERT(_state->attributes.empty() || _state->attributes.back().location < location, + CORRADE_ASSERT(_state->attributes.isEmpty() || _state->attributes.back().location < location, "Vk::MeshLayout::addAttribute(): location" << location << "can't be ordered after" << _state->attributes.back().location, *this); VkVertexInputAttributeDescription description{}; diff --git a/src/Magnum/Vk/RenderPass.cpp b/src/Magnum/Vk/RenderPass.cpp index 01b2c0a28..cd698f42a 100644 --- a/src/Magnum/Vk/RenderPass.cpp +++ b/src/Magnum/Vk/RenderPass.cpp @@ -306,7 +306,7 @@ template void SubpassDescription::setColorAttachmentsInternal(Container new(vkAttachments2 + i) VkAttachmentReference2(*wrappers[i]); } - if(!resolveAttachments.empty()) for(std::size_t i = 0; i != attachments.size(); ++i) { + if(!resolveAttachments.isEmpty()) for(std::size_t i = 0; i != attachments.size(); ++i) { new(resolveWrappers + i) AttachmentReference{resolveAttachments[i]}; /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ @@ -315,7 +315,7 @@ template void SubpassDescription::setColorAttachmentsInternal(Container _description.colorAttachmentCount = attachments.size(); _description.pColorAttachments = vkAttachments2; - _description.pResolveAttachments = resolveAttachments.empty() ? + _description.pResolveAttachments = resolveAttachments.isEmpty() ? nullptr : vkResolveAttachments2; } @@ -455,7 +455,7 @@ Containers::Array SubpassDescription::vkSubpassDescription /* Fill it with data and return, faking a size of 1 and with a custom deleter that correctly deletes as a char array again */ - std::pair out = vkSubpassDescriptionExtrasInto(_description, storage.suffix(sizeof(VkSubpassDescription))); + std::pair out = vkSubpassDescriptionExtrasInto(_description, storage.exceptPrefix(sizeof(VkSubpassDescription))); CORRADE_INTERNAL_ASSERT(out.second == extrasSize); *reinterpret_cast(storage.data()) = out.first; return Containers::Array{ diff --git a/src/Magnum/Vk/ShaderSet.cpp b/src/Magnum/Vk/ShaderSet.cpp index 5f2b19d98..3d392ca1a 100644 --- a/src/Magnum/Vk/ShaderSet.cpp +++ b/src/Magnum/Vk/ShaderSet.cpp @@ -87,7 +87,7 @@ ShaderSet& ShaderSet::addShader(const ShaderStage stage, const VkShaderModule sh /* Specialization, also only if there are any to avoid allocating the state struct when not necessary */ - if(!specializations.empty()) { + if(!specializations.isEmpty()) { if(!_state) _state.emplace(); /* Remember the original base data pointers so we can reroute the diff --git a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp index 1aa8cb126..058fa5363 100644 --- a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp @@ -155,7 +155,7 @@ DevicePropertiesVkTest::DevicePropertiesVkTest(): VulkanTester{NoCreate} { void DevicePropertiesVkTest::enumerate() { Containers::Array devices = enumerateDevices(instance()); Debug{} << "Found" << devices.size() << "devices"; - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); for(DeviceProperties& device: devices) { CORRADE_ITERATION(device.name()); @@ -177,7 +177,7 @@ void DevicePropertiesVkTest::enumerate() { void DevicePropertiesVkTest::constructMove() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); VkPhysicalDevice handle = devices[0].handle(); Containers::StringView name = devices[0].name(); @@ -322,7 +322,7 @@ void DevicePropertiesVkTest::featureExpectedUnsupported() { void DevicePropertiesVkTest::enumerateExtensions() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); ExtensionProperties properties = devices[0].enumerateExtensionProperties(); Debug{} << "Available device extension count:" << properties.names().size(); @@ -343,7 +343,7 @@ void DevicePropertiesVkTest::enumerateExtensionsWithKhronosValidationLayer() { CORRADE_SKIP("VK_LAYER_KHRONOS_validation not supported, can't test"); Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); /* There should be more extensions with this layer enabled */ ExtensionProperties global = devices[0].enumerateExtensionProperties(); @@ -368,7 +368,7 @@ void DevicePropertiesVkTest::enumerateExtensionsNonexistentLayer() { void DevicePropertiesVkTest::extensionConstructMove() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); ExtensionProperties a = devices[0].enumerateExtensionProperties(); const UnsignedInt count = a.count(); @@ -387,7 +387,7 @@ void DevicePropertiesVkTest::extensionConstructMove() { void DevicePropertiesVkTest::extensionIsSupported() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); ExtensionProperties properties = devices[0].enumerateExtensionProperties(); @@ -402,7 +402,7 @@ void DevicePropertiesVkTest::extensionIsSupported() { void DevicePropertiesVkTest::extensionIsSupportedRevision() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); ExtensionProperties properties = devices[0].enumerateExtensionProperties(); @@ -422,7 +422,7 @@ void DevicePropertiesVkTest::extensionIsSupportedRevision() { void DevicePropertiesVkTest::extensionNamedRevision() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); ExtensionProperties properties = devices[0].enumerateExtensionProperties(); @@ -440,7 +440,7 @@ void DevicePropertiesVkTest::extensionNamedRevision() { void DevicePropertiesVkTest::queueFamilies() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); Debug{} << "Available queue family count:" << devices[0].queueFamilyCount(); @@ -462,7 +462,7 @@ void DevicePropertiesVkTest::queueFamilies() { void DevicePropertiesVkTest::queueFamiliesOutOfRange() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); const UnsignedInt count = devices[0].queueFamilyCount(); @@ -477,7 +477,7 @@ void DevicePropertiesVkTest::queueFamiliesOutOfRange() { void DevicePropertiesVkTest::queueFamiliesPick() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); Containers::Optional id = devices[0].tryPickQueueFamily(QueueFlag::Compute|QueueFlag::Graphics); CORRADE_VERIFY(id); @@ -492,7 +492,7 @@ void DevicePropertiesVkTest::queueFamiliesPick() { void DevicePropertiesVkTest::queueFamiliesPickFailed() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); std::ostringstream out; Error redirectError{&out}; @@ -503,7 +503,7 @@ void DevicePropertiesVkTest::queueFamiliesPickFailed() { void DevicePropertiesVkTest::memoryHeaps() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); Debug{} << "Available memory heap count:" << devices[0].memoryHeapCount(); @@ -533,7 +533,7 @@ void DevicePropertiesVkTest::memoryHeapOutOfRange() { #endif Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); const UnsignedInt count = devices[0].memoryHeapCount(); @@ -548,7 +548,7 @@ void DevicePropertiesVkTest::memoryHeapOutOfRange() { void DevicePropertiesVkTest::memoryTypes() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); Debug{} << "Available memory type count:" << devices[0].memoryCount(); @@ -577,7 +577,7 @@ void DevicePropertiesVkTest::memoryTypeOutOfRange() { #endif Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); const UnsignedInt count = devices[0].memoryCount(); @@ -592,7 +592,7 @@ void DevicePropertiesVkTest::memoryTypeOutOfRange() { void DevicePropertiesVkTest::memoryTypesPick() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); Containers::Optional id = devices[0].tryPickMemory(MemoryFlag::HostVisible|MemoryFlag::HostCoherent); CORRADE_VERIFY(id); @@ -614,7 +614,7 @@ void DevicePropertiesVkTest::memoryTypesPick() { void DevicePropertiesVkTest::memoryTypesPickIgnoreSomePreferred() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); Containers::Optional id = devices[0].tryPickMemory({}, MemoryFlag::HostVisible|MemoryFlag::HostCoherent|MemoryFlag(0xcafe0000u)); CORRADE_VERIFY(id); @@ -635,7 +635,7 @@ void DevicePropertiesVkTest::memoryTypesPickFailed() { #endif Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); std::ostringstream out; Error redirectError{&out}; @@ -656,7 +656,7 @@ void DevicePropertiesVkTest::pickDevice() { void DevicePropertiesVkTest::pickDeviceIndex() { Containers::Array devices = enumerateDevices(instance()); - CORRADE_VERIFY(!devices.empty()); + CORRADE_VERIFY(!devices.isEmpty()); /* Pick the last one */ CORRADE_COMPARE_AS(devices.size(), 10, TestSuite::Compare::Less); diff --git a/src/Magnum/Vk/Test/DeviceVkTest.cpp b/src/Magnum/Vk/Test/DeviceVkTest.cpp index 5013d79a9..8db4031ed 100644 --- a/src/Magnum/Vk/Test/DeviceVkTest.cpp +++ b/src/Magnum/Vk/Test/DeviceVkTest.cpp @@ -289,7 +289,7 @@ void DeviceVkTest::createInfoExtensionsCopiedStrings() { if(std::getenv("MAGNUM_DISABLE_EXTENSIONS")) CORRADE_SKIP("Can't test with the MAGNUM_DISABLE_EXTENSIONS environment variable set"); - Containers::StringView globalButNotNullTerminated = "VK_KHR_maintenance25"_s.except(1); + Containers::StringView globalButNotNullTerminated = "VK_KHR_maintenance25"_s.exceptSuffix(1); Containers::String localButNullTerminated = Extensions::KHR::draw_indirect_count::string(); DeviceCreateInfo info{pickDevice(instance()), DeviceCreateInfo::Flag::NoImplicitExtensions}; diff --git a/src/Magnum/Vk/Test/InstanceVkTest.cpp b/src/Magnum/Vk/Test/InstanceVkTest.cpp index a75c5f009..8f6c52aca 100644 --- a/src/Magnum/Vk/Test/InstanceVkTest.cpp +++ b/src/Magnum/Vk/Test/InstanceVkTest.cpp @@ -290,7 +290,7 @@ void InstanceVkTest::createInfoExtensions() { } void InstanceVkTest::createInfoCopiedStrings() { - Containers::StringView globalButNotNullTerminated = "VK_LAYER_KHRONOS_validation3"_s.except(1); + Containers::StringView globalButNotNullTerminated = "VK_LAYER_KHRONOS_validation3"_s.exceptSuffix(1); Containers::String localButNullTerminated = Extensions::KHR::external_memory_capabilities::string(); InstanceCreateInfo info{InstanceCreateInfo::Flag::NoImplicitExtensions}; diff --git a/src/Magnum/Vk/Test/MeshTest.cpp b/src/Magnum/Vk/Test/MeshTest.cpp index 0f61a0dbf..af7421f37 100644 --- a/src/Magnum/Vk/Test/MeshTest.cpp +++ b/src/Magnum/Vk/Test/MeshTest.cpp @@ -129,9 +129,9 @@ void MeshTest::construct() { CORRADE_COMPARE(mesh.indexOffset(), 0); CORRADE_COMPARE(mesh.instanceCount(), 1); CORRADE_COMPARE(mesh.instanceOffset(), 0); - CORRADE_VERIFY(mesh.vertexBuffers().empty()); - CORRADE_VERIFY(mesh.vertexBufferOffsets().empty()); - CORRADE_VERIFY(mesh.vertexBufferStrides().empty()); + CORRADE_VERIFY(mesh.vertexBuffers().isEmpty()); + CORRADE_VERIFY(mesh.vertexBufferOffsets().isEmpty()); + CORRADE_VERIFY(mesh.vertexBufferStrides().isEmpty()); CORRADE_VERIFY(!mesh.isIndexed()); } diff --git a/src/Magnum/Vk/Test/MeshVkTest.cpp b/src/Magnum/Vk/Test/MeshVkTest.cpp index 4aaf51dbc..12ad663bc 100644 --- a/src/Magnum/Vk/Test/MeshVkTest.cpp +++ b/src/Magnum/Vk/Test/MeshVkTest.cpp @@ -330,7 +330,7 @@ void MeshVkTest::cmdDrawIndexed() { Utility::copy(Containers::stridedArrayView(QuadData).slice(&Quad::position), Containers::arrayCast(data.slice(32, 32 + 12*4))); Utility::copy(Containers::arrayCast(QuadIndexData), - Containers::stridedArrayView(data).suffix(32 + 12*4)); + Containers::stridedArrayView(data).exceptPrefix(32 + 12*4)); mesh.addVertexBuffer(0, buffer, 32) .setIndexBuffer(std::move(buffer), 32 + 12*4, MeshIndexType::UnsignedShort) .setCount(6); diff --git a/src/Magnum/Vk/Test/PipelineTest.cpp b/src/Magnum/Vk/Test/PipelineTest.cpp index ed33c45ba..80751fca5 100644 --- a/src/Magnum/Vk/Test/PipelineTest.cpp +++ b/src/Magnum/Vk/Test/PipelineTest.cpp @@ -556,7 +556,7 @@ void PipelineTest::computeCreateInfoConstruct() { void PipelineTest::computeCreateInfoConstructOwnedEntrypoint() { ShaderSet shaderSet; - shaderSet.addShader({}, {}, "dead!"_s.except(1)); + shaderSet.addShader({}, {}, "dead!"_s.exceptSuffix(1)); ComputePipelineCreateInfo info{shaderSet, {}}; CORRADE_COMPARE(info->stage.pName, "dead"_s); diff --git a/src/Magnum/Vk/Test/ShaderSetTest.cpp b/src/Magnum/Vk/Test/ShaderSetTest.cpp index 927e24c01..1f6bec8ff 100644 --- a/src/Magnum/Vk/Test/ShaderSetTest.cpp +++ b/src/Magnum/Vk/Test/ShaderSetTest.cpp @@ -96,7 +96,7 @@ void ShaderSetTest::specializationConstructBool() { void ShaderSetTest::construct() { ShaderSet set; - CORRADE_VERIFY(set.stages().empty()); + CORRADE_VERIFY(set.stages().isEmpty()); /* The actually meaningful test done in addShader() and friends */ } @@ -114,7 +114,7 @@ void ShaderSetTest::constructMove() { /* The double reinterpret_cast is needed because the handle is an uint64_t instead of a pointer on 32-bit builds and only this works on both */ - a.addShader(ShaderStage::Geometry, reinterpret_cast(reinterpret_cast(0xdeadbeef)), "main!"_s.except(1), { + a.addShader(ShaderStage::Geometry, reinterpret_cast(reinterpret_cast(0xdeadbeef)), "main!"_s.exceptSuffix(1), { {42, 1.15f} }); CORRADE_COMPARE(a.stages().size(), 1); @@ -127,7 +127,7 @@ void ShaderSetTest::constructMove() { CORRADE_COMPARE(*reinterpret_cast(a.stages()[0].pSpecializationInfo->pData), 1.15f); ShaderSet b = std::move(a); - CORRADE_VERIFY(a.stages().empty()); + CORRADE_VERIFY(a.stages().isEmpty()); CORRADE_COMPARE(b.stages().size(), 1); CORRADE_COMPARE(b.stages()[0].pName, "main"_s); CORRADE_VERIFY(b.stages()[0].pSpecializationInfo); @@ -138,7 +138,7 @@ void ShaderSetTest::constructMove() { CORRADE_COMPARE(*reinterpret_cast(b.stages()[0].pSpecializationInfo->pData), 1.15f); c = std::move(b); - CORRADE_VERIFY(b.stages().empty()); + CORRADE_VERIFY(b.stages().isEmpty()); } /* Doing this in outer scope to verify that the internal state pointer got @@ -170,7 +170,7 @@ void ShaderSetTest::addShader() { void ShaderSetTest::addShaderEntrypointCopy() { ShaderSet set; Containers::StringView entrypoint = "enterHere!"_s; - set.addShader(ShaderStage{}, {}, entrypoint.except(1)); + set.addShader(ShaderStage{}, {}, entrypoint.exceptSuffix(1)); CORRADE_COMPARE(set.stages().size(), 1); CORRADE_VERIFY(set.stages()[0].pName != entrypoint.data()); CORRADE_COMPARE(set.stages()[0].pName, "enterHere"_s); @@ -179,7 +179,7 @@ void ShaderSetTest::addShaderEntrypointCopy() { void ShaderSetTest::addShaderEntrypointCopyReallocation() { ShaderSet set; Containers::StringView entrypoint = "enterHere!"_s; - set.addShader(ShaderStage{}, {}, entrypoint.except(1)); + set.addShader(ShaderStage{}, {}, entrypoint.exceptSuffix(1)); CORRADE_COMPARE(set.stages().size(), 1); CORRADE_VERIFY(set.stages()[0].pName != entrypoint.data()); CORRADE_COMPARE(set.stages()[0].pName, "enterHere"_s); diff --git a/src/Magnum/Vk/vk-info.cpp b/src/Magnum/Vk/vk-info.cpp index 7a1a28577..f767555b6 100644 --- a/src/Magnum/Vk/vk-info.cpp +++ b/src/Magnum/Vk/vk-info.cpp @@ -333,7 +333,7 @@ int main(int argc, char** argv) { } else for(std::size_t i = instanceFuture; i != Containers::arraySize(versions); ++i) { Containers::ArrayView extensions = Vk::InstanceExtension::extensions(versions[i]); - if(extensions.empty()) continue; + if(extensions.isEmpty()) continue; if(versions[i] != Vk::Version::None) Debug{} << versions[i] << "instance extension support:"; @@ -366,7 +366,7 @@ int main(int argc, char** argv) { << Debug::packed << device.driverVersion(); } - if(devices.empty()) return 0; + if(devices.isEmpty()) return 0; } Debug{} << ""; @@ -412,7 +412,7 @@ int main(int argc, char** argv) { } else for(std::size_t i = deviceFuture; i != Containers::arraySize(versions); ++i) { Containers::ArrayView extensions = Vk::Extension::extensions(versions[i]); - if(extensions.empty()) continue; + if(extensions.isEmpty()) continue; if(versions[i] != Vk::Version::None) Debug{} << versions[i] << "extension support:"; diff --git a/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp b/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp index f1c2d79fc..21936b569 100644 --- a/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp +++ b/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp @@ -212,7 +212,7 @@ std::pair AnyConverter::doValidateFile(const Stage sta } /* Check that it can preprocess, in case we were asked to preprocess */ - if((!_state->definitionViews.empty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { + if((!_state->definitionViews.isEmpty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { Error{} << "ShaderTools::AnyConverter::validateFile():" << metadata->name() << "does not support preprocessing"; return {}; } @@ -223,7 +223,7 @@ std::pair AnyConverter::doValidateFile(const Stage sta converter->setOutputFormat(_state->outputFormat, _state->outputVersion); /* Propagate definitions, if any */ - if(!_state->definitionViews.empty()) + if(!_state->definitionViews.isEmpty()) converter->setDefinitions(_state->definitionViews); /* Propagate configuration */ @@ -269,7 +269,7 @@ std::pair AnyConverter::doValidateData(const Stage sta } /* Check that it can preprocess, in case we were asked to preprocess */ - if((!_state->definitionViews.empty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { + if((!_state->definitionViews.isEmpty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { Error{} << "ShaderTools::AnyConverter::validateData():" << metadata->name() << "does not support preprocessing"; return {}; } @@ -280,7 +280,7 @@ std::pair AnyConverter::doValidateData(const Stage sta converter->setOutputFormat(_state->outputFormat, _state->outputVersion); /* Propagate definitions, if any */ - if(!_state->definitionViews.empty()) + if(!_state->definitionViews.isEmpty()) converter->setDefinitions(_state->definitionViews); /* Propagate configuration */ @@ -337,7 +337,7 @@ bool AnyConverter::doConvertFileToFile(const Stage stage, const Containers::Stri } /* Check that it can preprocess, in case we were asked to preprocess */ - if((!_state->definitionViews.empty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { + if((!_state->definitionViews.isEmpty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { Error{} << "ShaderTools::AnyConverter::convertFileToFile():" << metadata->name() << "does not support preprocessing"; return {}; } @@ -360,7 +360,7 @@ bool AnyConverter::doConvertFileToFile(const Stage stage, const Containers::Stri converter->setOutputFormat(_state->outputFormat, _state->outputVersion); /* Propagate definitions and debug info, if any */ - if(!_state->definitionViews.empty()) + if(!_state->definitionViews.isEmpty()) converter->setDefinitions(_state->definitionViews); if(!_state->debugInfoLevel.isEmpty()) converter->setDebugInfoLevel(_state->debugInfoLevel); @@ -422,7 +422,7 @@ Containers::Array AnyConverter::doConvertFileToData(const Stage stage, con } /* Check that it can preprocess, in case we were asked to preprocess */ - if((!_state->definitionViews.empty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { + if((!_state->definitionViews.isEmpty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { Error{} << "ShaderTools::AnyConverter::convertFileToData():" << metadata->name() << "does not support preprocessing"; return {}; } @@ -445,7 +445,7 @@ Containers::Array AnyConverter::doConvertFileToData(const Stage stage, con converter->setOutputFormat(_state->outputFormat, _state->outputVersion); /* Propagate definitions and debug info, if any */ - if(!_state->definitionViews.empty()) + if(!_state->definitionViews.isEmpty()) converter->setDefinitions(_state->definitionViews); if(!_state->debugInfoLevel.isEmpty()) converter->setDebugInfoLevel(_state->debugInfoLevel); @@ -505,7 +505,7 @@ Containers::Array AnyConverter::doConvertDataToData(const Stage stage, con } /* Check that it can preprocess, in case we were asked to preprocess */ - if((!_state->definitionViews.empty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { + if((!_state->definitionViews.isEmpty() || (flags() & ConverterFlag::PreprocessOnly)) && !(converter->features() & ConverterFeature::Preprocess)) { Error{} << "ShaderTools::AnyConverter::convertDataToData():" << metadata->name() << "does not support preprocessing"; return {}; } @@ -528,7 +528,7 @@ Containers::Array AnyConverter::doConvertDataToData(const Stage stage, con converter->setOutputFormat(_state->outputFormat, _state->outputVersion); /* Propagate definitions and debug info, if any */ - if(!_state->definitionViews.empty()) + if(!_state->definitionViews.isEmpty()) converter->setDefinitions(_state->definitionViews); if(!_state->debugInfoLevel.isEmpty()) converter->setDebugInfoLevel(_state->debugInfoLevel); diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp index d667847c9..c832c4640 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp @@ -401,17 +401,17 @@ Containers::Optional ObjImporter::doMesh(UnsignedInt id, UnsignedInt) } /* There should be at least indexed position data */ - if(positions.empty() || indices.empty()) { + if(positions.isEmpty() || indices.isEmpty()) { Error() << "Trade::ObjImporter::mesh(): incomplete position data"; return Containers::NullOpt; } /* If there are index data, there should be also vertex data (and also the other way) */ - if(normals.empty() != (normalIndexCount == 0)) { + if(normals.isEmpty() != (normalIndexCount == 0)) { Error() << "Trade::ObjImporter::mesh(): incomplete normal data"; return Containers::NullOpt; } - if(textureCoordinates.empty() != (textureCoordinateIndexCount == 0)) { + if(textureCoordinates.isEmpty() != (textureCoordinateIndexCount == 0)) { Error() << "Trade::ObjImporter::mesh(): incomplete texture coordinate data"; return Containers::NullOpt; } diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp index 68881c656..b14600e16 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp @@ -69,7 +69,7 @@ Containers::Array TgaImageConverter::doConvertToData(const ImageView2D& im header->height = UnsignedShort(Utility::Endianness::littleEndian(image.size().y())); /* Copy the pixels into output, dropping padding (if any) */ - const Containers::ArrayView pixels = data.suffix(sizeof(Implementation::TgaHeader)); + const Containers::ArrayView pixels = data.exceptPrefix(sizeof(Implementation::TgaHeader)); Utility::copy(image.pixels(), Containers::StridedArrayView3D{pixels, {std::size_t(image.size().y()), std::size_t(image.size().x()), pixelSize}}); diff --git a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp index 3226201ab..8dfdd6a9a 100644 --- a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp @@ -119,11 +119,11 @@ const struct { } ShortData[] { {"short header", Containers::arrayView(Color24).prefix(17), "file too short, expected at least 18 bytes but got 17"}, - {"short data", Containers::arrayView(Color24).except(1), + {"short data", Containers::arrayView(Color24).exceptSuffix(1), "file too short, expected 36 bytes but got 35"}, - {"short RLE data", Containers::arrayView(Color24Rle).except(1), + {"short RLE data", Containers::arrayView(Color24Rle).exceptSuffix(1), "RLE file too short at pixel 3"}, - {"short RLE raw data", Containers::arrayView(Color24Rle).except(5), + {"short RLE raw data", Containers::arrayView(Color24Rle).exceptSuffix(5), "RLE file too short at pixel 0"} }; diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index 159815a31..671e59585 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -58,7 +58,7 @@ void TgaImporter::doOpenData(Containers::Array&& data, const DataFlags dat can't do the full import here because then doImage2D() would need to copy the imported data instead anyway. This way it'll also work nicely with a future openMemory(). */ - if(data.empty()) { + if(data.isEmpty()) { Error{} << "Trade::TgaImporter::openData(): the file is empty"; return; } @@ -134,7 +134,7 @@ Containers::Optional TgaImporter::doImage2D(UnsignedInt, UnsignedIn /* Copy data directly if not RLE */ Containers::Array data{outputSize}; - Containers::ArrayView srcPixels = _in.suffix(sizeof(Implementation::TgaHeader)); + Containers::ArrayView srcPixels = _in.exceptPrefix(sizeof(Implementation::TgaHeader)); if(!rle) { /* Files that are larger are allowed in this case (but not for RLE) */ if(srcPixels.size() < outputSize) { @@ -147,7 +147,7 @@ Containers::Optional TgaImporter::doImage2D(UnsignedInt, UnsignedIn /* Otherwise decode */ } else { Containers::ArrayView dstPixels = data; - while(!srcPixels.empty()) { + while(!srcPixels.isEmpty()) { /* Reference: http://www.paulbourke.net/dataformats/tga/ */ /* 8-bit RLE header. First bit denotes the operation, last 7 bits @@ -181,8 +181,8 @@ Containers::Optional TgaImporter::doImage2D(UnsignedInt, UnsignedIn Utility::copy(src, dst); /* Update views for the next round */ - srcPixels = srcPixels.suffix(1 + dataSize); - dstPixels = dstPixels.suffix(count*pixelSize); + srcPixels = srcPixels.exceptPrefix(1 + dataSize); + dstPixels = dstPixels.exceptPrefix(count*pixelSize); } } diff --git a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp index 7b8c447b5..896dd5246 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp +++ b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp @@ -215,7 +215,7 @@ void WavImporterTest::zeroSamples() { CORRADE_VERIFY(importer->openFile(Utility::Path::join(WAVAUDIOIMPORTER_TEST_DIR, "zeroSamples.wav"))); CORRADE_COMPARE(importer->format(), BufferFormat::Mono16); CORRADE_COMPARE(importer->frequency(), 22050); - CORRADE_VERIFY(importer->data().empty()); + CORRADE_VERIFY(importer->data().isEmpty()); } void WavImporterTest::mono4() {