diff options
author | Christian Strømme <christian.stromme@qt.io> | 2019-01-08 12:35:16 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-01-09 08:56:25 +0000 |
commit | 677fdcca5d0c498a85688180151a0ebaf181cb9a (patch) | |
tree | dfb9f479d431c3f8d348fc316dc002b62a7029a8 | |
parent | 9f92fcc309b10d2dc40e639c753588b8a5646a95 (diff) |
Change default animation system
The dragon wings animation system is now the one being used by default.
Enabling the old animation system can be done by setting the environment
variable Q3DS_NO_DRAGONWINGS or by setting the option --no-dragon-wings
when starting the viewer.
Change-Id: Ieb920e2bb2cea61f460ec175e7fee06821403903
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/runtime/slideplayerng/q3dsslideplayerng.cpp | 6 | ||||
-rw-r--r-- | tests/auto/slideplayer/tst_q3dsslideplayer.cpp | 12 | ||||
-rw-r--r-- | tests/auto/slides/tst_q3dsslides.cpp | 16 | ||||
-rw-r--r-- | tools/q3dsviewer/main.cpp | 8 |
4 files changed, 15 insertions, 27 deletions
diff --git a/src/runtime/slideplayerng/q3dsslideplayerng.cpp b/src/runtime/slideplayerng/q3dsslideplayerng.cpp index 1791384..8e217b3 100644 --- a/src/runtime/slideplayerng/q3dsslideplayerng.cpp +++ b/src/runtime/slideplayerng/q3dsslideplayerng.cpp @@ -60,13 +60,13 @@ static void forAllSlideComponents(Q3DSSlide *slide, std::function<void (Q3DSComp } bool Q3DSSlideUtils::useDragonWings() { - static bool b = qEnvironmentVariableIsSet("DRAGONWINGS"); + static bool b = qEnvironmentVariableIsSet("Q3DS_NO_DRAGONWINGS"); static bool first = true; if (b && first) { first = false; - qCDebug(lcAnim, "Using DragonWings animator!"); + qCDebug(lcAnim, "DragonWings animator disabled!"); } - return b; + return !b; } void Q3DSSlideUtils::getStartAndEndTime(Q3DSSlide *slide, qint32 *startTime, qint32 *endTime) diff --git a/tests/auto/slideplayer/tst_q3dsslideplayer.cpp b/tests/auto/slideplayer/tst_q3dsslideplayer.cpp index a199eb8..421c505 100644 --- a/tests/auto/slideplayer/tst_q3dsslideplayer.cpp +++ b/tests/auto/slideplayer/tst_q3dsslideplayer.cpp @@ -188,7 +188,7 @@ void tst_Q3DSSlidePlayer::tst_playModes() QCOMPARE(player->duration(), 1000); player->play(); QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Playing); - QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Stopped); + QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Paused); // Stopped -> playing -> stopped QCOMPARE(stateChangeSpy.count(), 2); @@ -207,7 +207,7 @@ void tst_Q3DSSlidePlayer::tst_playModes() QCOMPARE(player->duration(), 1000); player->play(); QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Playing); - QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Stopped); + QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Paused); // Stopped -> playing -> stopped QCOMPARE(stateChangeSpy.count(), 2); @@ -229,7 +229,7 @@ void tst_Q3DSSlidePlayer::tst_playModes() player->play(); QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Playing); - QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Stopped); + QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Paused); // Stopped -> playing -> stopped QCOMPARE(stateChangeSpy.count(), 2); @@ -250,7 +250,7 @@ void tst_Q3DSSlidePlayer::tst_playModes() player->play(); QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Playing); - QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Stopped); + QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Paused); // Stopped -> playing -> stopped QCOMPARE(stateChangeSpy.count(), 2); @@ -320,7 +320,7 @@ void tst_Q3DSSlidePlayer::tst_playModes() player->play(); QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Playing); - QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Stopped); + QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Paused); // Stopped -> playing -> stopped QCOMPARE(stateChangeSpy.count(), 2); @@ -343,7 +343,7 @@ void tst_Q3DSSlidePlayer::tst_playModes() player->play(); QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Playing); - QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Stopped); + QTRY_COMPARE(player->state(), Q3DSSlidePlayer::PlayerState::Paused); // Stopped -> playing -> stopped QCOMPARE(stateChangeSpy.count(), 2); diff --git a/tests/auto/slides/tst_q3dsslides.cpp b/tests/auto/slides/tst_q3dsslides.cpp index 59f57cb..8f0035a 100644 --- a/tests/auto/slides/tst_q3dsslides.cpp +++ b/tests/auto/slides/tst_q3dsslides.cpp @@ -598,12 +598,7 @@ void tst_Q3DSSlides::testTimeLineVisibility() QSignalSpy updateSpy(m_engine, SIGNAL(nextFrameStarting())); QSignalSpy positionChangedSpy(player, &Q3DSSlidePlayer::positionChanged); - const auto seekAndWait = [player, &updateSpy, &positionChangedSpy](int value) { - const float t = value; - player->seek(t); - QVERIFY(positionChangedSpy.wait(5000)); - QVERIFY(updateSpy.wait(5000)); - }; + const auto seekAndWait = [player](int value) { player->seek(value); }; m_sceneManager->setComponentCurrentSlide(m_componentSlide51); Q_ASSERT(m_componentSlide5MasterSlide == m_slide5Component->masterSlide()); @@ -611,14 +606,7 @@ void tst_Q3DSSlides::testTimeLineVisibility() compPlayer->stop(); QVERIFY(compPlayer); - QSignalSpy compPositionChangedSpy(compPlayer, &Q3DSSlidePlayer::positionChanged); - - const auto seekAndWaitForComp = [compPlayer, &updateSpy, &compPositionChangedSpy](int value) { - const float t = value; - compPlayer->seek(t); - QVERIFY(compPositionChangedSpy.wait(5000)); - QVERIFY(updateSpy.wait(5000)); - }; + const auto seekAndWaitForComp = [compPlayer](int value) { compPlayer->seek(value); }; seekAndWait(999); diff --git a/tools/q3dsviewer/main.cpp b/tools/q3dsviewer/main.cpp index 7444163..f4ec59a 100644 --- a/tools/q3dsviewer/main.cpp +++ b/tools/q3dsviewer/main.cpp @@ -93,12 +93,12 @@ int main(int argc, char *argv[]) cmdLineParser.addOption(matteColorOption); QCommandLineOption dragonRendererOption("dragon", QObject::tr("Awakens the Dragon!")); cmdLineParser.addOption(dragonRendererOption); - QCommandLineOption dragonWings("dragon-wings"); - cmdLineParser.addOption(dragonWings); + QCommandLineOption noDragonWings("no-dragon-wings"); + cmdLineParser.addOption(noDragonWings); cmdLineParser.process(app); - if (cmdLineParser.isSet(dragonWings)) - qputenv("DRAGONWINGS", QByteArray()); + if (cmdLineParser.isSet(noDragonWings)) + qputenv("Q3DS_NO_DRAGONWINGS", QByteArray()); QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); |