Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-04 03:27:20 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-04 03:27:20 +0400
commitec78eb353f71341f84999f47a7222becaadb8598 (patch)
tree0ae6937bcd59f93e0cec512f7b902686cf210e22 /source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
parent699da2fb0d9012cef5e45cc1b547a01fd92dbc1c (diff)
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! :)
Diffstat (limited to 'source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp')
-rw-r--r--source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
index 1a15fc849a6..10c6265ebb4 100644
--- a/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
+++ b/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
@@ -34,6 +34,8 @@
#include "Pow23GridDensityProvider.h"
+#include "BKE_global.h"
+
Pow23GridDensityProvider::Pow23GridDensityProvider(OccluderSource& source, const real proscenium[4], unsigned numFaces)
: GridDensityProvider(source), numFaces(numFaces)
{
@@ -66,13 +68,17 @@ void Pow23GridDensityProvider::initialize(const real proscenium[4])
float prosceniumWidth = (proscenium[1] - proscenium[0]);
float prosceniumHeight = (proscenium[3] - proscenium[2]);
real cellArea = prosceniumWidth * prosceniumHeight / pow(numFaces, 2.0f / 3.0f);
- cout << prosceniumWidth << " x " << prosceniumHeight << " grid with cells of area " << cellArea << "." << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << prosceniumWidth << " x " << prosceniumHeight << " grid with cells of area " << cellArea << "." << endl;
+ }
_cellSize = sqrt(cellArea);
// Now we know how many cells make each side of our grid
_cellsX = ceil(prosceniumWidth / _cellSize);
_cellsY = ceil(prosceniumHeight / _cellSize);
- cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ }
// Make sure the grid exceeds the proscenium by a small amount
float safetyZone = 0.1;
@@ -82,7 +88,9 @@ void Pow23GridDensityProvider::initialize(const real proscenium[4])
if (_cellsY * _cellSize < prosceniumHeight * (1.0 + safetyZone)) {
_cellsY = prosceniumHeight * (1.0 + safetyZone) / _cellSize;
}
- cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ }
// Find grid origin
_cellOrigin[0] = ((proscenium[0] + proscenium[1]) / 2.0) - (_cellsX / 2.0) * _cellSize;