diff options
| author | Cracker64 <cracker642@gmail.com> | 2010-11-30 19:43:42 (GMT) |
|---|---|---|
| committer | Cracker64 <cracker642@gmail.com> | 2010-11-30 19:43:42 (GMT) |
| commit | 491016eaf4b5f3065c43c0a142a0a0ebc2c3de63 (patch) | |
| tree | c037a08df7314ead03baabd3b458de903280406f /src/powder.c | |
| parent | bb16ffa2bbef12d8a8b1c151b3d987e272420675 (diff) | |
| download | powder-491016eaf4b5f3065c43c0a142a0a0ebc2c3de63.zip powder-491016eaf4b5f3065c43c0a142a0a0ebc2c3de63.tar.gz | |
Fixed love crash on mac, added adjustable grid mode, hit 'g', goes up to 9.
Diffstat (limited to 'src/powder.c')
| -rw-r--r-- | src/powder.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/powder.c b/src/powder.c index 32dc3a9..43ef467 100644 --- a/src/powder.c +++ b/src/powder.c @@ -922,25 +922,27 @@ void update_particles_i(pixel *vid, int start, int inc) if(ISLOVE==1) { ISLOVE = 0; - for(ny=4;ny<YRES-4;ny++) + for(ny=0;ny<YRES-4;ny++) { - for(nx=4;nx<XRES-4;nx++) + for(nx=0;nx<XRES-4;nx++) { r=pmap[ny][nx]; if((r>>8)>=NPART || !r) { continue; } - if(parts[r>>8].type==PT_LOVE) + else if((ny<9||nx<9||ny>YRES-7||nx>XRES-10)&&parts[r>>8].type==PT_LOVE) + parts[r>>8].type = PT_NONE; + else if(parts[r>>8].type==PT_LOVE) { love[nx/9][ny/9] = 1; } } } - for(nx=0;nx<=XRES-4;nx++) + for(nx=9;nx<=XRES-18;nx++) { - for(ny=0;ny<=YRES-4;ny++) + for(ny=9;ny<=YRES-7;ny++) { if(love[nx/9][ny/9]==1) { @@ -956,6 +958,8 @@ void update_particles_i(pixel *vid, int start, int inc) } if(!rt&&loverule[nnx][nny]==1) create_part(-1,nx+nnx,ny+nny,PT_LOVE); + else if(!rt) + continue; else if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) parts[rt>>8].type=PT_NONE; |
