From 677fdcca5d0c498a85688180151a0ebaf181cb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 8 Jan 2019 12:35:16 +0100 Subject: 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 --- src/runtime/slideplayerng/q3dsslideplayerng.cpp | 6 +++--- tests/auto/slideplayer/tst_q3dsslideplayer.cpp | 12 ++++++------ tests/auto/slides/tst_q3dsslides.cpp | 16 ++-------------- 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::functionduration(), 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()); -- cgit v1.2.3