summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-09 19:23:05 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-09 19:23:05 (GMT)
commit144e4bdb6991a042f9b985a9719299f612420dd0 (patch)
tree3da5132fc731dea1334048c707f4c074e390a86c /src/powder.c
parent56a3ad373c126da22be05e4c5b64a446c7d7dff0 (diff)
downloadpowder-144e4bdb6991a042f9b985a9719299f612420dd0.zip
powder-144e4bdb6991a042f9b985a9719299f612420dd0.tar.gz
Begin cleanup of update functions
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c
index 1124296..052415b 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -416,7 +416,7 @@ void kill_part(int i)
{
ISSPAWN2 = 0;
}
- if (x>=0 && y>=0 && x<XRES && y<YRES)
+ if (x>=0 && y>=0 && x<XRES && y<YRES && (pmap[y][x]>>8)==i)
pmap[y][x] = 0;
}
@@ -426,6 +426,21 @@ void kill_part(int i)
}
#if defined(WIN32) && !defined(__GNUC__)
+_inline void part_change_type(int n, int x, int y, int t)
+#else
+inline void part_change_type(int i, int x, int y, int t)
+#endif
+{
+ if (x<0 || y<0 || x>=XRES || y>=YRES || i>=NPART)
+ return -1;
+ parts[i].type = t;
+ if (t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT)
+ pmap[y][x] = t|(i<<8);
+ else if ((pmap[y][x]>>8)==i)
+ pmap[y][x] = 0;
+}
+
+#if defined(WIN32) && !defined(__GNUC__)
_inline int create_n_parts(int n, int x, int y, int t)
#else
inline int create_n_parts(int n, int x, int y, float vx, float vy, int t)
@@ -1676,6 +1691,8 @@ void update_particles_i(pixel *vid, int start, int inc)
if ((*(ptypes[t].update_func))(i,x,y,nx,ny,lx,ly,a))
continue;
}
+ if (legacy_enable)
+ update_legacy_all(i,x,y,nx,ny,lx,ly,a);
if (ptypes[t].properties&PROP_LIFE)
{
if (parts[i].temp>0)