From 4b6d9287bc3272c0495b8aab3b3542c6f8f4bb89 Mon Sep 17 00:00:00 2001 From: Laurens Voerman Date: Tue, 21 May 2019 13:28:41 +0200 Subject: [PATCH] replaced "if (apm || !apm->valid())" --- applications/osgviewer/osgviewer.cpp | 2 +- applications/present3D/present3D.cpp | 2 +- examples/osgCMakeExample/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index 0bdcc3681..d868c3faa 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -112,7 +112,7 @@ int main(int argc, char** argv) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { apm->setTimeScale(animationSpeed); diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index f5cb84cf7..ca2c5840e 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -484,7 +484,7 @@ int main( int argc, char **argv ) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); diff --git a/examples/osgCMakeExample/main.cpp b/examples/osgCMakeExample/main.cpp index d790d3873..e7592c8be 100644 --- a/examples/osgCMakeExample/main.cpp +++ b/examples/osgCMakeExample/main.cpp @@ -113,7 +113,7 @@ int main(int argc, char** argv) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { apm->setTimeScale(animationSpeed);