style cleanup
[blender.git] / source / blender / blenkernel / intern / pointcache.c
index f195b3d71b06e598754ad88ccc14d3bd42a70bc8..9c3c1b0e508ce0a00136e798a9e4009b0db2b9b5 100644 (file)
@@ -686,7 +686,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
 
        /* reallocate fluid if needed*/
        if (reallocate) {
-               sds->active_fields = active_fields;
+               sds->active_fields = active_fields | cache_fields;
                smoke_reallocate_fluid(sds, ch_dx, ch_res, 1);
                sds->dx = ch_dx;
                VECCOPY(sds->res, ch_res);
@@ -755,6 +755,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
                        if (cache_fields & SM_ACTIVE_FIRE) {
                                ptcache_file_compressed_read(pf, (unsigned char *)flame, out_len_big);
                                ptcache_file_compressed_read(pf, (unsigned char *)fuel, out_len_big);
+                               ptcache_file_compressed_read(pf, (unsigned char *)react, out_len_big);
                        }
                        if (cache_fields & SM_ACTIVE_COLORS) {
                                ptcache_file_compressed_read(pf, (unsigned char *)r, out_len_big);
@@ -1539,7 +1540,7 @@ void BKE_ptcache_mem_pointers_incr(PTCacheMem *pm)
 
        for (i=0; i<BPHYS_TOT_DATA; i++) {
                if (pm->cur[i])
-                       pm->cur[i] = (char*)pm->cur[i] + ptcache_data_size[i];
+                       pm->cur[i] = (char *)pm->cur[i] + ptcache_data_size[i];
        }
 }
 int  BKE_ptcache_mem_pointers_seek(int point_index, PTCacheMem *pm)
@@ -1557,7 +1558,7 @@ int  BKE_ptcache_mem_pointers_seek(int point_index, PTCacheMem *pm)
        }
 
        for (i=0; i<BPHYS_TOT_DATA; i++)
-               pm->cur[i] = data_types & (1<<i) ? (char*)pm->data[i] + index * ptcache_data_size[i] : NULL;
+               pm->cur[i] = data_types & (1<<i) ? (char *)pm->data[i] + index * ptcache_data_size[i] : NULL;
 
        return 1;
 }
@@ -2568,10 +2569,12 @@ int  BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
                        sbFreeSimulation(pid->calldata);
                else if (pid->type == PTCACHE_TYPE_PARTICLES)
                        psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH);
-               /*else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+#if 0
+               else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
                        smokeModifier_reset(pid->calldata);
                else if (pid->type == PTCACHE_TYPE_SMOKE_HIGHRES)
-                       smokeModifier_reset_turbulence(pid->calldata);*/
+                       smokeModifier_reset_turbulence(pid->calldata);
+#endif
                else if (pid->type == PTCACHE_TYPE_DYNAMICPAINT)
                        dynamicPaint_clearSurface((DynamicPaintSurface*)pid->calldata);
        }
@@ -2779,7 +2782,8 @@ static PointCache *ptcache_copy(PointCache *cache, int copy_data)
                ncache->mem_cache.last = NULL;
                ncache->cached_frames = NULL;
 
-               ncache->flag= 0;
+               /* flag is a mix of user settings and simulator/baking state */
+               ncache->flag= ncache->flag & (PTCACHE_DISK_CACHE|PTCACHE_EXTERNAL|PTCACHE_IGNORE_LIBPATH);
                ncache->simframe= 0;
        }
        else {