summaryrefslogtreecommitdiff
path: root/graphics.c
diff options
context:
space:
mode:
authorPhil <cracker642@gmail.com>2010-09-08 04:39:22 (GMT)
committer Phil <cracker642@gmail.com>2010-09-08 04:39:22 (GMT)
commitd28edfa6a9932b479efa36cdb9448354081c09ab (patch)
treefc35bd882c8da8d1fe6eb1ecb98e8efe5ae3b17b /graphics.c
parenteb7206aa304ac46ee08d4d2466b48ffe217f7bcb (diff)
downloadpowder-d28edfa6a9932b479efa36cdb9448354081c09ab.zip
powder-d28edfa6a9932b479efa36cdb9448354081c09ab.tar.gz
Fireworks glow in fancy display, fixed some crash errors they could cause.
Diffstat (limited to 'graphics.c')
-rw-r--r--graphics.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/graphics.c b/graphics.c
index c8eb964..1e5fd5d 100644
--- a/graphics.c
+++ b/graphics.c
@@ -1403,11 +1403,51 @@ void draw_parts(pixel *vid)
y = ny;
blendpixel(vid,x,y,17,217,24,255);
}
+ else if((t==PT_FWRK && parts[i].life >= 1)&&(cmode == 3||cmode==4 || cmode==6))
+ {
+ x = nx;
+ y = ny;
+ vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors;
+ cg = 10;
+ cb = 10;
+ cr = 10;
+ x = nx/CELL;
+ y = ny/CELL;
+ cg += fire_g[y][x];
+ if(cg > 255) cg = 255;
+ fire_g[y][x] = cg;
+ cb += fire_b[y][x];
+ if(cb > 255) cb = 255;
+ fire_b[y][x] = cb;
+ cr += fire_r[y][x];
+ if(cr > 255) cr = 255;
+ fire_r[y][x] = cr;
+ }
+
else if(t==PT_DUST && parts[i].life >= 1)
{
x = nx;
y = ny;
- blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255);
+ if(cmode == 3||cmode==4 || cmode==6)
+ {
+ vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags);
+ cg = parts[i].tmp/5;
+ cb = parts[i].ctype/5;
+ cr = parts[i].flags/5;
+ x = nx/CELL;
+ y = ny/CELL;
+ cg += fire_g[y][x];
+ if(cg > 255) cg = 255;
+ fire_g[y][x] = cg;
+ cb += fire_b[y][x];
+ if(cb > 255) cb = 255;
+ fire_b[y][x] = cb;
+ cr += fire_r[y][x];
+ if(cr > 255) cr = 255;
+ fire_r[y][x] = cr;
+ }
+ else
+ blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255);
}
else if(t==PT_LNTG&&cmode == 6)
{