summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-08-19 16:53:56 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-08-19 16:53:56 (GMT)
commitac4ffb8d5dbb2e3fe10a979e0cdc6c34a2a8a31f (patch)
tree5d944a09c2a8e77919d3358ae3e987e19eb024f0 /src/graphics.c
parenta85121d767432b7754bf9a6dce04eca37be52f1a (diff)
downloadpowder-ac4ffb8d5dbb2e3fe10a979e0cdc6c34a2a8a31f.zip
powder-ac4ffb8d5dbb2e3fe10a979e0cdc6c34a2a8a31f.tar.gz
Fancy Coal effects
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 233a178..696cab9 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -3470,6 +3470,69 @@ void draw_parts(pixel *vid)
fire_b[y][x] = cb;
}
}
+ /*else if((t==PT_COAL || t==PT_BCOL) && parts[i].tmp2 > 100.0f-80.0f){
+ float frequency = 3.1415/(2*100.0f-(100.0f-80.0f));
+ int q = (parts[i].tmp2>100.0f)?100.0f-(100.0f-80.0f):parts[i].tmp2-(100.0f-80.0f);
+ cr = PIXR(ptypes[t].pcolors);
+ cg = PIXG(ptypes[t].pcolors);
+ cb = PIXB(ptypes[t].pcolors);
+
+ cr += parts[i].tmp2;
+ cg += parts[i].tmp2;
+ cb += parts[i].tmp2;
+
+
+ cr += sin(frequency*q) * 226;
+ cg += sin(frequency*q*4.55 +3.14) * 34;
+ cb += sin(frequency*q*2.22 +3.14) * 64;
+
+ 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_COAL || t==PT_BCOL){
+ cr = PIXR(ptypes[t].pcolors);
+ cg = PIXG(ptypes[t].pcolors);
+ cb = PIXB(ptypes[t].pcolors);
+
+ cr += (parts[i].tmp2-273.15f)/3;
+ cg += (parts[i].tmp2-273.15f)/3;
+ cb += (parts[i].tmp2-273.15f)/3;
+
+ if((parts[i].temp-273.15f) > 300.0f-200.0f)
+ {
+ float frequency = 3.1415/(2*300.0f-(300.0f-200.0f));
+ int q = ((parts[i].temp-273.15f)>300.0f)?300.0f-(300.0f-200.0f):(parts[i].temp-273.15f)-(300.0f-200.0f);
+
+ cr += sin(frequency*q) * 226;
+ cg += sin(frequency*q*4.55 +3.14) * 34;
+ cb += sin(frequency*q*2.22 +3.14) * 64;
+ }
+
+ 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 no special effect, draw a simple pixel
vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors;
}