Fix #33353: Smoke color problems with adaptive domain

High resolution cache didn't always read all written data fields which caused colors to get messed up.
This commit is contained in:
Miika Hamalainen
2012-11-30 11:01:14 +00:00
parent 323e86694e
commit d2a741048a
2 changed files with 3 additions and 2 deletions

View 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);

View File

@@ -165,7 +165,7 @@ void flame_get_spectrum(unsigned char *UNUSED(spec), int UNUSED(width), float UN
void smoke_reallocate_fluid(SmokeDomainSettings *sds, float dx, int res[3], int free_old)
{
int use_heat = (sds->active_fields & SM_ACTIVE_HEAT);
int use_fire = (sds->active_fields & (SM_ACTIVE_HEAT | SM_ACTIVE_FIRE));
int use_fire = (sds->active_fields & SM_ACTIVE_FIRE);
int use_colors = (sds->active_fields & SM_ACTIVE_COLORS);
if (free_old && sds->fluid)