diff options
| author | Simon <simon@hardwired.org.uk> | 2011-01-05 20:36:09 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2011-01-05 20:36:09 (GMT) |
| commit | a46a484f2eececfb79bd7f5dd2e3456eeb77c192 (patch) | |
| tree | 4c3c5ac6bd4a3848f151257fb5ca17bb26005207 /src | |
| parent | e2d4ae576355626ea07aa83db817bd0104dd7e6c (diff) | |
| download | powder-a46a484f2eececfb79bd7f5dd2e3456eeb77c192.zip powder-a46a484f2eececfb79bd7f5dd2e3456eeb77c192.tar.gz | |
Fix acid drawing and 'purple acid'
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 20 | ||||
| -rw-r--r-- | src/powder.c | 12 |
2 files changed, 20 insertions, 12 deletions
diff --git a/src/graphics.c b/src/graphics.c index 73a8f59..525f0bb 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1934,13 +1934,21 @@ void draw_parts(pixel *vid) } else if(t==PT_ACID) { - if(parts[i].life>255) parts[i].life = 255; - if(parts[i].life<47) parts[i].life = 48; - s = (255/((parts[i].life-46)*28)); + if(parts[i].life>75) parts[i].life = 75; + if(parts[i].life<49) parts[i].life = 49; + s = (parts[i].life-49)*3; if(s==0) s = 1; - cr = PIXR(ptypes[t].pcolors)/s; - cg = PIXG(ptypes[t].pcolors)/s; - cb = PIXB(ptypes[t].pcolors)/s; + cr = 0x86 + s*4; + cg = 0x36 + s*1; + cb = 0x90 + s*2; + + if(cr>=255) + cr = 255; + if(cg>=255) + cg = 255; + if(cb>=255) + cb = 255; + blendpixel(vid, nx, ny, cr, cg, cb, 255); if(cmode==CM_BLOB) diff --git a/src/powder.c b/src/powder.c index a7f8a3e..ec6ac33 100644 --- a/src/powder.c +++ b/src/powder.c @@ -2495,13 +2495,13 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) { - if(parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS) - { - parts[i].life--; - parts[r>>8].type = PT_NONE; - } + if(parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS) + { + parts[i].life--; + parts[r>>8].type = PT_NONE; + } } - else if (parts[i].life==50) + else if (parts[i].life<=50) { parts[i].life = 0; t = parts[i].type = PT_NONE; |
