summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2010-12-24 20:59:27 (GMT)
committer Cracker64 <cracker642@gmail.com>2010-12-24 20:59:27 (GMT)
commit0dbb53606bca11d98cef874ff3c117c980e2b909 (patch)
tree5f6adedc3ee8bd4af1d0e1769f05ca6eab144c01 /src/graphics.c
parent65a60b3812b708620b4ff4b13c3521fa5e4547ab (diff)
downloadpowder-0dbb53606bca11d98cef874ff3c117c980e2b909.zip
powder-0dbb53606bca11d98cef874ff3c117c980e2b909.tar.gz
forgot PROP thing in powder.h, adjustments to heat glow and BOMB
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c71
1 files changed, 23 insertions, 48 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 9beeeb0..a2e73e6 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1459,49 +1459,24 @@ void draw_parts(pixel *vid)
}
else if(cmode==CM_GRAD)
{
- if((t==PT_METL||t==PT_BRMT||t==PT_BMTL)&&parts[i].temp>473&&parts[i].temp<1370)
- {
- float frequency = 0.00146;
- int q = 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
- {
- float frequency = 0.05;
- int q = parts[i].temp-40;
- 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);
- }
-
+ float frequency = 0.05;
+ int q = parts[i].temp-40;
+ 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)
{
@@ -2425,12 +2400,12 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
}
}
- else if(t==PT_BOMB){
+ else if(t==PT_BOMB){
if(parts[i].tmp==0){
cr = PIXR(ptypes[t].pcolors);
cg = PIXG(ptypes[t].pcolors);
cb = PIXB(ptypes[t].pcolors);
- if(cmode != CM_NOTHING && cmode != CM_CRACK){
+ if(cmode != CM_CRACK){
int newx = 0;
float gradv = 100;
blendpixel(vid, nx+1, ny, cr, cg, cb, 223);
@@ -2456,7 +2431,7 @@ void draw_parts(pixel *vid)
cr = PIXR(ptypes[t].pcolors);
cg = PIXG(ptypes[t].pcolors);
cb = PIXB(ptypes[t].pcolors);
- if(cmode != CM_NOTHING && cmode != CM_CRACK){
+ if(cmode != CM_CRACK){
int newx = 0;
float gradv = 4*parts[i].life;
for(newx = 0; gradv>0.5; newx++){
@@ -2476,8 +2451,8 @@ 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;
+ float frequency = 3.1415/(2*pstates[t].ltemp-473.0);
+ int q = (parts[i].temp>pstates[t].ltemp)?pstates[t].ltemp-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);