summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-02-26 19:32:51 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2011-02-26 19:32:51 (GMT)
commitded7bdf30d87601e125ce06fee0a6614cd424f73 (patch)
tree9b9004facb67d6276e9a2c8f6c79449834c5a229 /src/powder.c
parenta972644c4ffda6774ecea2798ff6d76f09d8f04e (diff)
parent669a672b3d083af22c6aeb37a636903ce30bcf6c (diff)
downloadpowder-ded7bdf30d87601e125ce06fee0a6614cd424f73.zip
powder-ded7bdf30d87601e125ce06fee0a6614cd424f73.tar.gz
Merge branch 'upstream' into dev
Conflicts: src/main.c
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/powder.c b/src/powder.c
index bb77385..dbbfe0c 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1320,8 +1320,12 @@ void update_particles_i(pixel *vid, int start, int inc)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)//it will count itself as its own neighbor, which is needed, but will have 1 extra for delete check
{
- gol2[((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL][((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][golnum] ++;
- gol2[((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL][((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][0] ++;
+ rt = pmap[((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL];
+ if (!rt || ptypes[rt&0xFF].properties&PROP_LIFE)
+ {
+ gol2[((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL][((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][golnum] ++;
+ gol2[((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL][((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][0] ++;
+ }
}
} else {
parts[r>>8].tmp --;
@@ -1353,10 +1357,12 @@ void update_particles_i(pixel *vid, int start, int inc)
if (r && parts[r>>8].tmp<=0)
parts[r>>8].type = PT_NONE;//using kill_part makes it not work
}
+ for( z = 0;z<=NGOL;z++)
+ gol2[nx][ny][z] = 0;//this improves performance A LOT compared to the memset, i was getting ~23 more fps with this.
}
if (createdsomething)
GENERATION ++;
- memset(gol2, 0, sizeof(gol2));
+ //memset(gol2, 0, sizeof(gol2));
}
if (ISWIRE==1)
{
@@ -2858,6 +2864,10 @@ int create_parts(int x, int y, int rx, int ry, int c)
b = WL_FANHELPER;
dw = 1;
}
+ if (c == PT_WIND)
+ {
+ return 1;
+ }
if (dw==1)
{
rx = rx/CELL;