From 743292421640c012f7a029ae2e0d9a312b01895f Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 18 Mar 2013 21:33:48 +0000 Subject: Smoke Bugfix /enhancement: Load pre 2.65 pointcaches. Warning: Just make sure that you DON'T free the cache at any point. This patch can only display existing pointcaches from e.g. 2.64 --- intern/smoke/intern/smoke_API.cpp | 42 ++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'intern/smoke') diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp index 6011de0bddb..67f1ea29533 100644 --- a/intern/smoke/intern/smoke_API.cpp +++ b/intern/smoke/intern/smoke_API.cpp @@ -172,17 +172,25 @@ extern "C" void smoke_export(FLUID_3D *fluid, float *dt, float *dx, float **dens float **heatold, float **vx, float **vy, float **vz, float **r, float **g, float **b, unsigned char **obstacles) { *dens = fluid->_density; - *fuel = fluid->_fuel; - *react = fluid->_react; - *flame = fluid->_flame; - *heat = fluid->_heat; - *heatold = fluid->_heatOld; + if(fuel) + *fuel = fluid->_fuel; + if(react) + *react = fluid->_react; + if(flame) + *flame = fluid->_flame; + if(heat) + *heat = fluid->_heat; + if(heatold) + *heatold = fluid->_heatOld; *vx = fluid->_xVelocity; *vy = fluid->_yVelocity; *vz = fluid->_zVelocity; - *r = fluid->_color_r; - *g = fluid->_color_g; - *b = fluid->_color_b; + if(r) + *r = fluid->_color_r; + if(g) + *g = fluid->_color_g; + if(b) + *b = fluid->_color_b; *obstacles = fluid->_obstacles; *dt = fluid->_dt; *dx = fluid->_dx; @@ -195,12 +203,18 @@ extern "C" void smoke_turbulence_export(WTURBULENCE *wt, float **dens, float **r return; *dens = wt->_densityBig; - *fuel = wt->_fuelBig; - *react = wt->_reactBig; - *flame = wt->_flameBig; - *r = wt->_color_rBig; - *g = wt->_color_gBig; - *b = wt->_color_bBig; + if(fuel) + *fuel = wt->_fuelBig; + if(react) + *react = wt->_reactBig; + if(flame) + *flame = wt->_flameBig; + if(r) + *r = wt->_color_rBig; + if(g) + *g = wt->_color_gBig; + if(b) + *b = wt->_color_bBig; *tcu = wt->_tcU; *tcv = wt->_tcV; *tcw = wt->_tcW; -- cgit v1.2.3