style cleanup
[blender.git] / source / blender / blenkernel / intern / pointcache.c
index 3f2eb32f61c6a42ff5ea771f7d47e4ca59f614aa..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;
 }
@@ -2781,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 {