summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-07 20:26:09 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-07 20:26:09 (GMT)
commit6908f3dd0b65c127b0c3aa665fa1edc71d68ae1c (patch)
tree0d66aefad5e67bb025ec71b4592ef6a0096c58f9 /src/powder.c
parentb69712bbdbaf32fef65e15141458cb27f9f7ec88 (diff)
downloadpowder-6908f3dd0b65c127b0c3aa665fa1edc71d68ae1c.zip
powder-6908f3dd0b65c127b0c3aa665fa1edc71d68ae1c.tar.gz
Tidy up.
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/src/powder.c b/src/powder.c
index 7d87108..b531a63 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1331,18 +1331,9 @@ void update_particles_i(pixel *vid, int start, int inc)
continue;
}
- vx[y/CELL][x/CELL] *= ptypes[t].airloss;
- vy[y/CELL][x/CELL] *= ptypes[t].airloss;
- if (t==PT_ANAR)
- {
- vx[y/CELL][x/CELL] -= ptypes[t].airdrag*parts[i].vx;
- vy[y/CELL][x/CELL] -= ptypes[t].airdrag*parts[i].vy;
- }
- else
- {
- vx[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vx;
- vy[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vy;
- }
+ vx[y/CELL][x/CELL] = vx[y/CELL][x/CELL]*ptypes[t].airloss + ptypes[t].airdrag*parts[i].vx;
+ vy[y/CELL][x/CELL] = vy[y/CELL][x/CELL]*ptypes[t].airloss + ptypes[t].airdrag*parts[i].vy;
+
if (t==PT_GAS||t==PT_NBLE)
{
if (pv[y/CELL][x/CELL]<3.5f)
@@ -1439,16 +1430,8 @@ void update_particles_i(pixel *vid, int start, int inc)
}
- if (t==PT_ANAR)
- {
- parts[i].vx -= ptypes[t].advection*vx[y/CELL][x/CELL] + pGravX;
- parts[i].vy -= ptypes[t].advection*vy[y/CELL][x/CELL] + pGravY;
- }
- else {
- parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL] + pGravX;
- parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + pGravY;
-
- }
+ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL] + pGravX;
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + pGravY;
}
if (ptypes[t].diffusion)
@@ -1720,11 +1703,7 @@ void update_particles_i(pixel *vid, int start, int inc)
pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP);
}
}
- if (t==PT_PTCT&&parts[i].temp>295.0f)
- {
- pt = parts[i].temp -= 2.5f;
- }
- if (t==PT_NTCT&&parts[i].temp>295.0f)
+ if ((t==PT_PTCT||t==PT_NTCT)&&parts[i].temp>295.0f)
{
pt = parts[i].temp -= 2.5f;
}
@@ -2089,11 +2068,6 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
- if (t==PT_SWCH)
- if ((parts[i].life>0&&parts[i].life<10)|| parts[i].life > 10)
- {
- parts[i].life--;
- }
if (t==PT_SPRK) {
ct = parts[i].ctype;