diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2012-02-10 16:31:13 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-14 09:13:49 +0100 |
commit | 964b3ba57fd75900d6275905c2f96cce345c4920 (patch) | |
tree | b2b77d3ca65044ddf09e552d59d5e7d217e337b8 /src/plugins | |
parent | 67b8bff512ea8b523a21dfacd2c816f5df7284ae (diff) |
Suppress debug output on model load.
Switch to using an environment variable for displaying model debug
output.
The _DEBUG macro is not a guarantee that the debug output will only be
produced in debug builds, since its not respected by some compilers.
In any case, even in debug mode lots of spurious output is not desired.
Let's remove the _DEBUG macro, in favour of a documented environment
variable.
Change-Id: Icfb2d0bb22ad311e204ddd3cbddb5cb74a2f6b46
Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/sceneformats/assimp/qaiscenehandler.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/sceneformats/assimp/qaiscenehandler.cpp b/src/plugins/sceneformats/assimp/qaiscenehandler.cpp index c24b430fd..1df438233 100644 --- a/src/plugins/sceneformats/assimp/qaiscenehandler.cpp +++ b/src/plugins/sceneformats/assimp/qaiscenehandler.cpp @@ -67,9 +67,7 @@ QT_BEGIN_NAMESPACE -#ifdef _DEBUG void DumpScene(const aiScene* pScene); -#endif QAiSceneHandler::QAiSceneHandler() : m_options(qAiPostProcessPreset) @@ -278,11 +276,10 @@ QGLAbstractScene *QAiSceneHandler::read() qWarning("For details check log: %s/AssimpLog.txt\n", qPrintable(c)); return 0; } -#ifdef _DEBUG else { - DumpScene(scene); + if (!qgetenv("QT3D_DEBUG_MODEL").isEmpty()) + DumpScene(scene); } -#endif QAiScene *qscene = new QAiScene(scene, this); @@ -291,7 +288,6 @@ QGLAbstractScene *QAiSceneHandler::read() return qscene; } -#ifdef _DEBUG void LogPrint(const char* pFormat, ...) { static char buff[1024]; @@ -299,7 +295,9 @@ void LogPrint(const char* pFormat, ...) va_list args; va_start(args, pFormat); vsnprintf( buff, sizeof(buff) - 1, pFormat, args); +#ifndef QT_NO_DEBUG_STREAM qDebug() << buff; +#endif } void DumpAnimation(int i, const aiAnimation* pAnimation, const aiScene* pScene) @@ -353,6 +351,5 @@ void DumpScene(const aiScene* pScene) DumpNodeRecursive(0,pScene->mRootNode,pScene); } } -#endif QT_END_NAMESPACE |