Browse Source

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.
pull/601/head
Vladimír Vondruš 3 years ago
parent
commit
c8d009f0a9
  1. 64
      src/Magnum/Trade/AbstractSceneConverter.cpp

64
src/Magnum/Trade/AbstractSceneConverter.cpp

@ -1624,16 +1624,36 @@ bool AbstractSceneConverter::addSupportedImporterContents(AbstractImporter& impo
/* To avoid needlessly querying fooCount() several times (which might be /* To avoid needlessly querying fooCount() several times (which might be
expensive in certain unfortunate cases), this basically unwraps the expensive in certain unfortunate cases), this basically unwraps the
contents of sceneContentsFor(const AbstractImporter&) and adds warnings 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; SceneContents used = contents;
UnsignedInt count; UnsignedInt count;
if((wantedButUnsupported & SceneContent::Scenes) && (count = importer.sceneCount())) { if((wantedButUnsupported & SceneContent::Meshes) && (count = importer.meshCount())) {
Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "scenes not supported by the converter"; Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "meshes not supported by the converter";
used &= ~SceneContent::Scenes; used &= ~SceneContent::Meshes;
} }
if((wantedButUnsupported & SceneContent::Animations) && (count = importer.animationCount())) { if((wantedButUnsupported & SceneContent::Images1D) && (count = importer.image1DCount())) {
Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "animations not supported by the converter"; Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "1D images not supported by the converter";
used &= ~SceneContent::Animations; 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())) { if((wantedButUnsupported & SceneContent::Lights) && (count = importer.lightCount())) {
Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "lights not supported by the converter"; 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"; Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "cameras not supported by the converter";
used &= ~SceneContent::Cameras; 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())) { if((wantedButUnsupported & SceneContent::Skins2D) && (count = importer.skin2DCount())) {
Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "2D skins not supported by the converter"; Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "2D skins not supported by the converter";
used &= ~SceneContent::Skins2D; 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"; Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "3D skins not supported by the converter";
used &= ~SceneContent::Skins3D; used &= ~SceneContent::Skins3D;
} }
if((wantedButUnsupported & SceneContent::Meshes) && (count = importer.meshCount())) { if((wantedButUnsupported & SceneContent::Animations) && (count = importer.animationCount())) {
Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "meshes not supported by the converter"; Warning{} << "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring" << count << "animations not supported by the converter";
used &= ~SceneContent::Meshes; used &= ~SceneContent::Animations;
}
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;
} }
/* MeshLevels and ImageLevels handled inside */ /* MeshLevels and ImageLevels handled inside */

Loading…
Cancel
Save