From ec78eb353f71341f84999f47a7222becaadb8598 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Thu, 3 Jan 2013 23:27:20 +0000 Subject: New command-line option --debug-freestyle to enable verbose debug messages on the console during Freestyle rendering. The debug prints are turned off by default now. Errors are still printed on the console. A patch set implementing this functionality was provided by Bastien Montagne. Many thanks! :) --- source/blender/freestyle/intern/geometry/FastGrid.cpp | 8 ++++++-- source/blender/freestyle/intern/geometry/GeomCleaner.cpp | 11 +++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'source/blender/freestyle/intern/geometry') diff --git a/source/blender/freestyle/intern/geometry/FastGrid.cpp b/source/blender/freestyle/intern/geometry/FastGrid.cpp index f5f9bc1079e..7051d960346 100644 --- a/source/blender/freestyle/intern/geometry/FastGrid.cpp +++ b/source/blender/freestyle/intern/geometry/FastGrid.cpp @@ -34,6 +34,8 @@ #include "FastGrid.h" +#include "BKE_global.h" + void FastGrid::clear() { if (!_cells) @@ -61,8 +63,10 @@ void FastGrid::configure(const Vec3r& orig, const Vec3r& size, unsigned nb) Cell *FastGrid::getCell(const Vec3u& p) { #if 0 - cout << _cells << " " << p << " " << _cells_nb[0] << "-" << _cells_nb[1] << "-" << _cells_nb[2] - << " " << _cells_size << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << _cells << " " << p << " " << _cells_nb[0] << "-" << _cells_nb[1] << "-" << _cells_nb[2] + << " " << _cells_size << endl; + } #endif assert(_cells || ("_cells is a null pointer")); assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size); diff --git a/source/blender/freestyle/intern/geometry/GeomCleaner.cpp b/source/blender/freestyle/intern/geometry/GeomCleaner.cpp index aba845a2faf..c90513c6294 100644 --- a/source/blender/freestyle/intern/geometry/GeomCleaner.cpp +++ b/source/blender/freestyle/intern/geometry/GeomCleaner.cpp @@ -50,6 +50,8 @@ #include "../system/TimeUtils.h" +#include "BKE_global.h" + using namespace std; @@ -157,12 +159,17 @@ void GeomCleaner::SortAndCompressIndexedVertexArray(const float *iVertices, unsi // Sort data chrono.start(); GeomCleaner::SortIndexedVertexArray(iVertices, iVSize, iIndices, iISize, &tmpVertices, &tmpIndices); - printf("Sorting: %lf\n", chrono.stop()); + if (G.debug & G_DEBUG_FREESTYLE) { + printf("Sorting: %lf\n", chrono.stop()); + } // compress data chrono.start(); GeomCleaner::CompressIndexedVertexArray(tmpVertices, iVSize, tmpIndices, iISize, oVertices, oVSize, oIndices); - printf("Merging: %lf\n", chrono.stop()); + real duration = chrono.stop(); + if (G.debug & G_DEBUG_FREESTYLE) { + printf("Merging: %lf\n", duration); + } // deallocates memory: delete [] tmpVertices; -- cgit v1.2.3