From 2b962212c8be78603dc49fecaf080f44614af8ee Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 5 Dec 2012 15:46:31 +0000 Subject: Fix #33411: crash baking smoke with FFT high resolution. CMake had FFTW disabled by default, and when FFTW was not enabled it lead to uninitialized memory usage. Now it falls back to wavelet if there is no FFTW, and I've enabled it by default in CMake. If it's not found on Linux it will get disabled automatically. --- intern/smoke/intern/WTURBULENCE.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'intern') diff --git a/intern/smoke/intern/WTURBULENCE.cpp b/intern/smoke/intern/WTURBULENCE.cpp index 1c89f5d681b..5b6509afead 100644 --- a/intern/smoke/intern/WTURBULENCE.cpp +++ b/intern/smoke/intern/WTURBULENCE.cpp @@ -220,21 +220,25 @@ void WTURBULENCE::setNoise(int type) { if(type == (1<<1)) // FFT { +#ifdef WITH_FFTW3 // needs fft - #ifdef WITH_FFTW3 std::string noiseTileFilename = std::string("noise.fft"); generatTile_FFT(_noiseTile, noiseTileFilename); - #endif + return; +#else + fprintf(stderr, "FFTW not enabled, falling back to wavelet noise.\n"); +#endif } - else if(type == (1<<2)) // curl +#if 0 + if(type == (1<<2)) // curl { // TODO: not supported yet + return; } - else // standard - wavelet - { - std::string noiseTileFilename = std::string("noise.wavelets"); - generateTile_WAVELET(_noiseTile, noiseTileFilename); - } +#endif + + std::string noiseTileFilename = std::string("noise.wavelets"); + generateTile_WAVELET(_noiseTile, noiseTileFilename); } // init direct access functions from blender -- cgit v1.2.3