summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-12-24 13:51:09 (GMT)
committer Simon <simon@hardwired.org.uk>2010-12-24 13:51:09 (GMT)
commit1983512b3df7c6b3500a3618832ed9296a1ac215 (patch)
treef6db8c1d165a9dc5db9dbe10edc268160c94c344 /src
parentdb364c549f70668c632bfdc55aaf441142ef646e (diff)
downloadpowder-1983512b3df7c6b3500a3618832ed9296a1ac215.zip
powder-1983512b3df7c6b3500a3618832ed9296a1ac215.tar.gz
Hot metal glow for more views
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 7a79651..b74646e 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -2474,6 +2474,27 @@ void draw_parts(pixel *vid)
}
}
+ 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));