diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2010-02-07 17:25:09 +0300 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2010-02-07 17:25:09 +0300 |
commit | dedbf8608e38a165e2667623b2e8075a2a743a77 (patch) | |
tree | 7fa3f5ac8ce43828877bb07de464259bf34ee379 /source/blender/editors/physics | |
parent | 81fd89c8e0f2f4642b00a263e68227cdb8637a3d (diff) |
Smoke: Patch #20955 / fix by Damien Plisson (damien78)
* Smoke got it's own thread loop now and can be esc'ed now
* Apple OpenMP bug workaround until they fix the GCC (couldn't test this one)
* removing some "static" keyword to prevent crashing on frame display
* should also fix problems with wavelet.noise crashing (Bug #20710)
Fluid:
* sleep delay has been reduced to be more responsive
* Fluid progress is displayed in percent using the mouse cursor (like smoke)
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index eec971e777e..b1a3a3be28d 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -109,9 +109,9 @@ static void *thread_tls_data; /* XXX */ /* from header info.c */ static int start_progress_bar(void) {return 0;}; -static void end_progress_bar(void) {}; +static void end_progress_bar(wmWindow *win) {WM_cursor_restore(win);}; static void waitcursor(int val) {}; -static int progress_bar(float done, char *busy_info) {return 0;} +static int progress_bar(wmWindow *win, float done, char *busy_info) { WM_timecursor(win,done*100); return 0;} static int pupmenu() {return 0;} /* XXX */ @@ -1060,7 +1060,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob) { int done = 0; float noFramesf = (float)noFrames; - float percentdone = 0.0; + float percentdone = 0.0, oldpercentdone = -1.0; int lastRedraw = -1; g_break= 0; @@ -1075,11 +1075,15 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob) // lukep we add progress bar as an interim mesure percentdone = globalBakeFrame / noFramesf; - sprintf(busy_mess, "baking fluids %d / %d |||", globalBakeFrame, (int) noFramesf); - progress_bar(percentdone, busy_mess ); + if (percentdone != oldpercentdone) { + sprintf(busy_mess, "baking fluids %d / %d |||", globalBakeFrame, (int) noFramesf); + percentdone = percentdone < 0.0 ? 0.0:percentdone; + progress_bar(CTX_wm_window(C), percentdone, busy_mess ); + oldpercentdone = percentdone; + } - // longer delay to prevent frequent redrawing - PIL_sleep_ms(2000); + //XXX no more need for longer delay to prevent frequent redrawing + PIL_sleep_ms(200); BLI_lock_thread(LOCK_CUSTOM1); if(globalBakeState != 0) done = 1; // 1=ok, <0=error/abort @@ -1121,7 +1125,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob) #endif } // redraw } - end_progress_bar(); + end_progress_bar(CTX_wm_window(C)); } BLI_end_threads(&threads); } // El'Beem API init, thread creation |