summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2010-12-04 17:24:54 (GMT)
committer Cracker64 <cracker642@gmail.com>2010-12-04 17:24:54 (GMT)
commitd56684312dd9429da8be8666206ad1656d3185a9 (patch)
treed8db260b8b24c1e193bc6a76700cb1de374ed7ef /src/graphics.c
parent01a2dcaf419b207702d959a5016107674c636325 (diff)
downloadpowder-d56684312dd9429da8be8666206ad1656d3185a9.zip
powder-d56684312dd9429da8be8666206ad1656d3185a9.tar.gz
WIFI, a wireless SPRK transmitter, has 25 'channels' controlled by temp. starting at 0C, every 100 degrees is a different channel, they are colored as well. Heat-gradient display, colors of elements is slightly changed based on temp. maybe some other fixes.
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c
index ed1a4b3..1af3f9b 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1409,6 +1409,29 @@ void draw_parts(pixel *vid)
cb = PIXB(ptypes[t].pcolors);
blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
+ if(cmode==CM_GRAD)
+ {
+ float frequency = 0.05;
+ int q = parts[i].temp;
+ cr = sin(frequency*q) * 16 + PIXR(ptypes[t].pcolors);
+ cg = sin(frequency*q) * 16 + PIXG(ptypes[t].pcolors);
+ cb = sin(frequency*q) * 16 + 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_MWAX&&cmode == CM_FANCY)
{
for(x=-1; x<=1; x++)
@@ -1539,6 +1562,15 @@ void draw_parts(pixel *vid)
cb=255;
blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
+ else if(t==PT_WIFI)
+ {
+ float frequency = 0.25;
+ int q = parts[i].tmp;
+ cr = sin(frequency*q + 0) * 127 + 128;
+ cg = sin(frequency*q + 2) * 127 + 128;
+ cb = sin(frequency*q + 4) * 127 + 128;
+ blendpixel(vid, nx, ny, cr, cg, cb, 255);
+ }
else if(t==PT_PIPE)
{
if(parts[i].ctype==2)