From c8d009f0a91b667ec5e0f0e3e9bda611322ab179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 18 Jan 2023 17:54:43 +0100 Subject: [PATCH] Trade: sort addSupporterImporterContents() warnings by dependency order. To match the order (and thus also verbose log) in which they're added inside addImporterContents(), and subsequently also the order magnum-sceneconverter processes them manually. There's no reason to have it different and cause confusion. --- src/Magnum/Trade/AbstractSceneConverter.cpp | 64 +++++++++++---------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/Magnum/Trade/AbstractSceneConverter.cpp b/src/Magnum/Trade/AbstractSceneConverter.cpp index f1fa18864..4aa72f880 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.cpp +++ b/src/Magnum/Trade/AbstractSceneConverter.cpp @@ -1624,16 +1624,36 @@ bool AbstractSceneConverter::addSupportedImporterContents(AbstractImporter& impo /* To avoid needlessly querying fooCount() several times (which might be expensive in certain unfortunate cases), this basically unwraps the contents of sceneContentsFor(const AbstractImporter&) and adds warnings - there */ + there. + + The data kinds are in dependency order, matching the order in + addImporterContentsInternal(), so when warnings are printed they're not + in an order different from the verbose output for no reason. */ SceneContents used = contents; UnsignedInt count; - if((wantedButUnsupported & SceneContent::Scenes) && (count = importer.sceneCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "scenes not supported by the converter"; - used &= ~SceneContent::Scenes; + if((wantedButUnsupported & SceneContent::Meshes) && (count = importer.meshCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "meshes not supported by the converter"; + used &= ~SceneContent::Meshes; } - if((wantedButUnsupported & SceneContent::Animations) && (count = importer.animationCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "animations not supported by the converter"; - used &= ~SceneContent::Animations; + if((wantedButUnsupported & SceneContent::Images1D) && (count = importer.image1DCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "1D images not supported by the converter"; + used &= ~SceneContent::Images1D; + } + if((wantedButUnsupported & SceneContent::Images2D) && (count = importer.image2DCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "2D images not supported by the converter"; + used &= ~SceneContent::Images2D; + } + if((wantedButUnsupported & SceneContent::Images3D) && (count = importer.image3DCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "3D images not supported by the converter"; + used &= ~SceneContent::Images3D; + } + if((wantedButUnsupported & SceneContent::Textures) && (count = importer.textureCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "textures not supported by the converter"; + used &= ~SceneContent::Textures; + } + if((wantedButUnsupported & SceneContent::Materials) && (count = importer.materialCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "materials not supported by the converter"; + used &= ~SceneContent::Materials; } if((wantedButUnsupported & SceneContent::Lights) && (count = importer.lightCount())) { Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "lights not supported by the converter"; @@ -1643,6 +1663,10 @@ bool AbstractSceneConverter::addSupportedImporterContents(AbstractImporter& impo Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "cameras not supported by the converter"; used &= ~SceneContent::Cameras; } + if((wantedButUnsupported & SceneContent::Scenes) && (count = importer.sceneCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "scenes not supported by the converter"; + used &= ~SceneContent::Scenes; + } if((wantedButUnsupported & SceneContent::Skins2D) && (count = importer.skin2DCount())) { Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "2D skins not supported by the converter"; used &= ~SceneContent::Skins2D; @@ -1651,29 +1675,9 @@ bool AbstractSceneConverter::addSupportedImporterContents(AbstractImporter& impo Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "3D skins not supported by the converter"; used &= ~SceneContent::Skins3D; } - if((wantedButUnsupported & SceneContent::Meshes) && (count = importer.meshCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "meshes not supported by the converter"; - used &= ~SceneContent::Meshes; - } - if((wantedButUnsupported & SceneContent::Materials) && (count = importer.materialCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "materials not supported by the converter"; - used &= ~SceneContent::Materials; - } - if((wantedButUnsupported & SceneContent::Textures) && (count = importer.textureCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "textures not supported by the converter"; - used &= ~SceneContent::Textures; - } - if((wantedButUnsupported & SceneContent::Images1D) && (count = importer.image1DCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "1D images not supported by the converter"; - used &= ~SceneContent::Images1D; - } - if((wantedButUnsupported & SceneContent::Images2D) && (count = importer.image2DCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "2D images not supported by the converter"; - used &= ~SceneContent::Images2D; - } - if((wantedButUnsupported & SceneContent::Images3D) && (count = importer.image3DCount())) { - Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "3D images not supported by the converter"; - used &= ~SceneContent::Images3D; + if((wantedButUnsupported & SceneContent::Animations) && (count = importer.animationCount())) { + Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "animations not supported by the converter"; + used &= ~SceneContent::Animations; } /* MeshLevels and ImageLevels handled inside */