diff options
Diffstat (limited to 'src/graphics.c')
| -rw-r--r-- | src/graphics.c | 94 |
1 files changed, 82 insertions, 12 deletions
diff --git a/src/graphics.c b/src/graphics.c index e719a04..b74646e 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1451,13 +1451,13 @@ void draw_parts(pixel *vid) } else { - cr = PIXR(ptypes[t].pcolors); - cg = PIXG(ptypes[t].pcolors); - cb = PIXB(ptypes[t].pcolors); - blendpixel(vid, nx, ny, cr, cg, cb, 255); + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + blendpixel(vid, nx, ny, cr, cg, cb, 255); } - } - else if(cmode==CM_GRAD) + } + else if(cmode==CM_GRAD)//forgot to put else, broke nothing view { if((t==PT_METL||t==PT_BRMT||t==PT_BMTL)&&parts[i].temp>473&&parts[i].temp<1370) { @@ -2425,6 +2425,76 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } } + else if(t==PT_BOMB){ + if(parts[i].tmp==0){ + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + if(cmode != CM_NOTHING && cmode != CM_CRACK){ + int newx = 0; + float gradv = 100; + blendpixel(vid, nx+1, ny, cr, cg, cb, 223); + blendpixel(vid, nx-1, ny, cr, cg, cb, 223); + blendpixel(vid, nx, ny+1, cr, cg, cb, 223); + blendpixel(vid, nx, ny-1, cr, cg, cb, 223); + + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 112); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 112); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 112); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 112); + for(newx = 0; gradv>0.5; newx++){ + addpixel(vid, nx+newx, ny, cr, cg, cb, gradv); + addpixel(vid, nx-newx, ny, cr, cg, cb, gradv); + + addpixel(vid, nx, ny+newx, cr, cg, cb, gradv); + addpixel(vid, nx, ny-newx, cr, cg, cb, gradv); + gradv = gradv/1.1f; + } + } + } + else if(parts[i].tmp==1){ + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + if(cmode != CM_NOTHING && cmode != CM_CRACK){ + int newx = 0; + float gradv = 4*parts[i].life; + for(newx = 0; gradv>0.5; newx++){ + addpixel(vid, nx+newx, ny, cr, cg, cb, gradv); + addpixel(vid, nx-newx, ny, cr, cg, cb, gradv); + + addpixel(vid, nx, ny+newx, cr, cg, cb, gradv); + addpixel(vid, nx, ny-newx, cr, cg, cb, gradv); + gradv = gradv/1.5f; + } + } + } + else { + blendpixel(vid, nx, ny, 255, 255, 255, 255); + } + + } + else if(ptypes[t].properties&PROP_HOT_GLOW && parts[i].temp>473.0f) + { + float frequency = 0.00146; + int q = (parts[i].temp>1370)?1370-473:parts[i].temp-473; + cr = sin(frequency*q) * 226 + PIXR(ptypes[t].pcolors); + cg = sin(frequency*q*4.55 +3.14) * 34 + PIXG(ptypes[t].pcolors); + cb = sin(frequency*q*2.22 +3.14) * 64 + PIXB(ptypes[t].pcolors); + if(cr>=255) + cr = 255; + if(cg>=255) + cg = 255; + if(cb>=255) + cb = 255; + if(cr<=0) + cr = 0; + if(cg<=0) + cg = 0; + if(cb<=0) + cb = 0; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + } else if(t==PT_FIRE && parts[i].life) { float ttemp = (float)((int)(parts[i].life/2)); @@ -2961,12 +3031,12 @@ pixel *prerender_save(void *save, int size, int *width, int *height) if(!(j%2) && !(i%2)) fb[(ry+j)*w+(rx+i)] = PIXPACK(0xC0C0C0); break; - case 4: - for(j=0; j<CELL; j+=2) - for(i=(j>>1)&1; i<CELL; i+=2) - fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF); - k++; - break; + case 4: + for(j=0; j<CELL; j+=2) + for(i=(j>>1)&1; i<CELL; i+=2) + fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF); + k++; + break; case 6: for(j=0; j<CELL; j+=2) for(i=(j>>1)&1; i<CELL; i+=2) |
