summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2011-02-23 20:35:02 (GMT)
committer Simon <simon@hardwired.org.uk>2011-02-23 20:35:02 (GMT)
commit5d4d815ad3e6510210c8b6646d972f317cb44caa (patch)
tree9163696078af1b35cb3a907cdb34438533ea2091 /src/graphics.c
parentfa76c4b45cd8de61508c62e8d276aee5a6083769 (diff)
downloadpowder-5d4d815ad3e6510210c8b6646d972f317cb44caa.zip
powder-5d4d815ad3e6510210c8b6646d972f317cb44caa.tar.gz
Fancier glow, now affected by Velocity, Pressure and Heat
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/graphics.c b/src/graphics.c
index ea8d0d5..4b29dc7 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -2370,15 +2370,15 @@ void draw_parts(pixel *vid)
}
else if (t==PT_GLOW)
{
- fg = 0;
- fb = 0;
- fr = 0;
- if (pv[ny/CELL][nx/CELL]>0) {
- fg = 6 * pv[ny/CELL][nx/CELL];
- fb = 4 * pv[ny/CELL][nx/CELL];
- fr = 2 * pv[ny/CELL][nx/CELL];
- }
- vid[ny*(XRES+BARSIZE)+nx] = PIXRGB((int)restrict_flt(0x44 + fr*8, 0, 255), (int)restrict_flt(0x88 + fg*8, 0, 255), (int)restrict_flt(0x44 + fb*8, 0, 255));
+ fr = restrict_flt(parts[i].temp-(275.13f+32.0f), 0, 128)/50.0f;
+ fg = restrict_flt(parts[i].life, 0, 128)/50.0f;
+ fb = restrict_flt(parts[i].tmp, 0, 128)/50.0f;
+
+ cr = restrict_flt(64.0f+parts[i].temp-(275.13f+32.0f), 0, 255);
+ cg = restrict_flt(64.0f+parts[i].life, 0, 255);
+ cb = restrict_flt(64.0f+parts[i].tmp, 0, 255);
+
+ vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr, cg, cb);
if (cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
{
x = nx/CELL;
@@ -2394,19 +2394,15 @@ void draw_parts(pixel *vid)
fire_r[y][x] = fr;
}
if (cmode == CM_BLOB) {
- uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255);
- uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255);
- uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255);
-
- blendpixel(vid, nx+1, ny, R, G, B, 223);
- blendpixel(vid, nx-1, ny, R, G, B, 223);
- blendpixel(vid, nx, ny+1, R, G, B, 223);
- blendpixel(vid, nx, ny-1, R, G, B, 223);
-
- blendpixel(vid, nx+1, ny-1, R, G, B, 112);
- blendpixel(vid, nx-1, ny-1, R, G, B, 112);
- blendpixel(vid, nx+1, ny+1, R, G, B, 112);
- blendpixel(vid, nx-1, ny+1, R, G, B, 112);
+ 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);
}
}
else if (t==PT_LCRY)