Browse Source

Trade: expand SceneConverterFeature to 64 bits.

We'll need many MANY more than just 8 bits for the generic export.
pull/559/head
Vladimír Vondruš 4 years ago
parent
commit
ee983fd098
  1. 2
      src/Magnum/Trade/AbstractSceneConverter.cpp
  2. 2
      src/Magnum/Trade/AbstractSceneConverter.h
  3. 14
      src/Magnum/Trade/Test/AbstractSceneConverterTest.cpp

2
src/Magnum/Trade/AbstractSceneConverter.cpp

@ -215,7 +215,7 @@ Debug& operator<<(Debug& debug, const SceneConverterFeature value) {
/* LCOV_EXCL_STOP */
}
return debug << "(" << Debug::nospace << reinterpret_cast<void*>(UnsignedByte(value)) << Debug::nospace << ")";
return debug << "(" << Debug::nospace << reinterpret_cast<void*>(UnsignedLong(value)) << Debug::nospace << ")";
}
Debug& operator<<(Debug& debug, const SceneConverterFeatures value) {

2
src/Magnum/Trade/AbstractSceneConverter.h

@ -53,7 +53,7 @@ namespace Magnum { namespace Trade {
@see @ref SceneConverterFeatures, @ref AbstractSceneConverter::features()
*/
enum class SceneConverterFeature: UnsignedByte {
enum class SceneConverterFeature: UnsignedLong {
/**
* Convert a mesh with
* @ref AbstractSceneConverter::convert(const MeshData&).

14
src/Magnum/Trade/Test/AbstractSceneConverterTest.cpp

@ -186,7 +186,7 @@ void AbstractSceneConverterTest::thingNotSupported() {
struct: AbstractSceneConverter {
SceneConverterFeatures doFeatures() const override {
/* Assuming this bit is unused */
return SceneConverterFeature(1 << 7);
return SceneConverterFeature(1ull << 63);
}
} converter;
@ -539,8 +539,16 @@ void AbstractSceneConverterTest::convertMeshToFileNotImplemented() {
void AbstractSceneConverterTest::debugFeature() {
std::ostringstream out;
Debug{&out} << SceneConverterFeature::ConvertMeshInPlace << SceneConverterFeature(0xf0);
CORRADE_COMPARE(out.str(), "Trade::SceneConverterFeature::ConvertMeshInPlace Trade::SceneConverterFeature(0xf0)\n");
Debug{&out} << SceneConverterFeature::ConvertMeshInPlace << SceneConverterFeature(0xbafabafadeaddead);
{
#ifdef CORRADE_TARGET_32BIT
CORRADE_EXPECT_FAIL("Debug has shitty hex printing currently, using just the low 32 bits on 32-bit platforms.");
#endif
CORRADE_COMPARE(out.str(), "Trade::SceneConverterFeature::ConvertMeshInPlace Trade::SceneConverterFeature(0xbafabafadeaddead)\n");
}
#ifdef CORRADE_TARGET_32BIT
CORRADE_COMPARE(out.str(), "Trade::SceneConverterFeature::ConvertMeshInPlace Trade::SceneConverterFeature(0xdeaddead)\n");
#endif
}
void AbstractSceneConverterTest::debugFeatures() {

Loading…
Cancel
Save