diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-08-24 15:35:52 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-27 10:37:03 (GMT) |
| commit | 42cfb74c2bb82eb185962a17f848e47265a16316 (patch) | |
| tree | d2185ba1276dd85144b7d26099f597833f0cc975 /src/elements/pipe.c | |
| parent | f97e8e5c7caddadadf71f7635070777c6e1248ad (diff) | |
| download | powder-42cfb74c2bb82eb185962a17f848e47265a16316.zip powder-42cfb74c2bb82eb185962a17f848e47265a16316.tar.gz | |
Remove blocking walls from pmap
2.5% speed increase on a screen full of water
Diffstat (limited to 'src/elements/pipe.c')
| -rw-r--r-- | src/elements/pipe.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/elements/pipe.c b/src/elements/pipe.c index 0d66482..af008dc 100644 --- a/src/elements/pipe.c +++ b/src/elements/pipe.c @@ -25,7 +25,7 @@ void pushParticle(int i, int count, int original) if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) { r = pmap[y+ry][x+rx]; - if ((r>>8)>=NPART || !r) + if (!r) continue; else if ((r&0xFF)==PT_PIPE && parts[r>>8].ctype!=notctype && (parts[r>>8].tmp&0xFF)==0) { @@ -47,7 +47,7 @@ void pushParticle(int i, int count, int original) { int coords = 7 - (parts[i].tmp>>10); r = pmap[y+ pos_1_ry[coords]][x+ pos_1_rx[coords]]; - if ((r>>8)>=NPART || !r) + if (!r) { } else if ((r&0xFF)==PT_PIPE && parts[r>>8].ctype!=notctype && (parts[r>>8].tmp&0xFF)==0) @@ -85,7 +85,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) { if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) { r = pmap[y+ry][x+rx]; - if ((r>>8)>=NPART || !r) + if (!r) continue; if ((r&0xFF)==PT_PIPE&&parts[r>>8].ctype==1) { @@ -130,8 +130,6 @@ int update_PIPE(UPDATE_FUNC_ARGS) { if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) { r = pmap[y+ry][x+rx]; - if ((r>>8)>=NPART) - return 0; if (surround_space && !r && (parts[i].tmp&0xFF)!=0) //creating at end { np = create_part(-1,x+rx,y+ry,parts[i].tmp&0xFF); |
