Avoid stacking in INVS and FILT, and fix pressurised INVS graphics

Collisions now always work for particles inside INVS and FILT, so
particles don't stack (just a single particle on top of each INVS/FILT).

Pressurised INVS was being drawn using PMODE_FLAT (with no alpha
blending), which sometimes hid particles inside INVS.

Also limit BHOL tmp value to make sure it saves correctly.
This commit is contained in:
jacksonmj 2012-06-09 12:34:06 +01:00
parent 601766a3a0
commit 303a32f290
2 changed files with 6 additions and 3 deletions

View File

@ -249,8 +249,7 @@ int graphics_INVS(GRAPHICS_FUNC_ARGS)
*colr = 15; *colr = 15;
*colg = 0; *colg = 0;
*colb = 150; *colb = 150;
*pixel_mode &= PMODE; *pixel_mode = PMODE_BLEND;
*pixel_mode |= PMODE_BLEND;
} }
return 0; return 0;
} }

View File

@ -1567,6 +1567,7 @@ void update_particles_i(pixel *vid, int start, int inc)
create_part(i, x, y, PT_NBHL); create_part(i, x, y, PT_NBHL);
parts[i].temp = MAX_TEMP; parts[i].temp = MAX_TEMP;
parts[i].tmp = pmap_count[y][x]-NPART;//strength of grav field parts[i].tmp = pmap_count[y][x]-NPART;//strength of grav field
if (parts[i].tmp>51200) parts[i].tmp = 51200;
pmap_count[y][x] = NPART; pmap_count[y][x] = NPART;
} }
else else
@ -2859,7 +2860,10 @@ void update_particles(pixel *vid)//doesn't update the particles themselves, but
photons[y][x] = t|(i<<8); photons[y][x] = t|(i<<8);
else else
{ {
pmap[y][x] = t|(i<<8); // Particles are sometimes allowed to go inside INVS and FILT
// To make particles collide correctly when inside these elements, these elements must not overwrite an existing pmap entry from particles inside them
if (!pmap[y][x] || (t!=PT_INVIS && t!= PT_FILT))
pmap[y][x] = t|(i<<8);
pmap_count[y][x]++; pmap_count[y][x]++;
} }
} }