diff options
| author | Simon <simon@hardwired.org.uk> | 2011-01-05 19:42:31 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2011-01-05 19:42:31 (GMT) |
| commit | 71c5d53f7f65941834d15e91e7871bff32f3c821 (patch) | |
| tree | 2c281ecd53414e148c8bfa9cfa47fcaba1bacf42 /src | |
| parent | 5d7c0194f18d0fce25b0703b80829b0d0a719a96 (diff) | |
| parent | cf2489916c6055327f9def21ee70088f4023a384 (diff) | |
| download | powder-71c5d53f7f65941834d15e91e7871bff32f3c821.zip powder-71c5d53f7f65941834d15e91e7871bff32f3c821.tar.gz | |
Changes by cracker
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 2 | ||||
| -rw-r--r-- | src/main.c | 19 | ||||
| -rw-r--r-- | src/powder.c | 53 |
3 files changed, 54 insertions, 20 deletions
diff --git a/src/graphics.c b/src/graphics.c index c98df3c..73a8f59 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1987,7 +1987,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } - } + } else if(t==PT_FILT) { int temp_bin = (int)((parts[i].temp-273.0f)*0.025f); @@ -1516,8 +1516,19 @@ int main(int argc, char *argv[]) else GRID_MODE = (GRID_MODE+1)%10; } + if(sdl_key=='=') + { + int nx, ny; + for(nx = 0;nx<XRES/CELL;nx++) + for(ny = 0;ny<YRES/CELL;ny++) + { + pv[ny][nx] = 0; + vx[ny][nx] = 0; + vy[ny][nx] = 0; + } + } - if(sdl_key=='w') //Gravity, by Moach + if(sdl_key=='w' && (!isplayer2 || (sdl_mod & (KMOD_SHIFT)))) //Gravity, by Moach { ++gravityMode; // cycle gravity mode itc = 51; @@ -1621,7 +1632,7 @@ int main(int argc, char *argv[]) if(vs>=1) vs = 0; else - vs = 2; + vs = 3;//every other frame } else { @@ -2060,6 +2071,10 @@ int main(int argc, char *argv[]) svf_tags[0] = 0; svf_description[0] = 0; gravityMode = 1; + isplayer2 = 0; + isplayer = 0; + ISSPAWN1 = 0; + ISSPAWN2 = 0; memset(fire_bg, 0, XRES*YRES*PIXELSIZE); memset(fire_r, 0, sizeof(fire_r)); diff --git a/src/powder.c b/src/powder.c index cbb2ab2..e30a0b4 100644 --- a/src/powder.c +++ b/src/powder.c @@ -564,11 +564,17 @@ inline int create_part(int p, int x, int y, int t) return -1; if(p==-1)//creating from anything but brush { - if(pmap[y][x]) - if((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2) - if(t!=PT_STKM&&t!=PT_STKM2) - return -1; - if(pfree == -1) + if(pmap[y][x]) + { + if((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2) + { + if(t!=PT_STKM&&t!=PT_STKM2) + { + return -1; + } + } + } + if(pfree == -1) return -1; i = pfree; pfree = parts[i].life; @@ -577,19 +583,24 @@ inline int create_part(int p, int x, int y, int t) { if(pmap[y][x]) { - if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN)) + if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN&&t!=PT_STKM&&t!=PT_STKM2)) { - parts[pmap[y][x]>>8].ctype = t; + if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN)) + { + parts[pmap[y][x]>>8].ctype = t; + } + return -1; } - return -1; + if(pfree == -1) + return -1; + i = pfree; + pfree = parts[i].life; } - if(pfree == -1) - return -1; - i = pfree; - pfree = parts[i].life; - } - else - i = p; + else + { + i = p; + } + } if(t==PT_GLAS) { @@ -2129,7 +2140,7 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(parts[r>>8].type==PT_FILT){ colored = parts[r>>8].ctype; - }else if(parts[r>>8].type!=PT_INWR && parts[r>>8].type!=PT_ARAY) { + }else if(parts[r>>8].type!=PT_INWR && parts[r>>8].type!=PT_ARAY && parts[r>>8].type!=PT_WIFI) { if(nyy!=0 || nxx!=0){ create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK); } @@ -2143,6 +2154,8 @@ void update_particles_i(pixel *vid, int start, int inc) if(parts[r>>8].type==PT_BRAY){ parts[r>>8].life = 1; docontinue = 1; + } else if(parts[r>>8].type==PT_INWR || parts[r>>8].type==PT_ARAY || parts[r>>8].type==PT_WIFI) { + docontinue = 1; } else { docontinue = 0; } @@ -3377,6 +3390,12 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].ctype = PT_PSCN; parts[r>>8].life = 4; } + else if(parts[r>>8].type==PT_INWR&&parts[r>>8].life==0 && wireless[parts[i].tmp][0]) + { + parts[r>>8].type = PT_SPRK; + parts[r>>8].ctype = PT_INWR; + parts[r>>8].life = 4; + } else if(parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp][0]) { //parts[r>>8].type = parts[r>>8].ctype; @@ -5051,7 +5070,7 @@ killed: parts[i].vx *= ptypes[t].collision; parts[i].vy *= ptypes[t].collision; } - else if(ptypes[t].falldown>1 && parts[i].vy>fabs(parts[i].vx)) + else if(ptypes[t].falldown>1 && (parts[i].vy>fabs(parts[i].vx) || gravityMode==2)) { s = 0; if(!rt || nt) //nt is if there is an something else besides the current particle type, around the particle |
