summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/graphics.c71
-rw-r--r--src/powder.c21
2 files changed, 34 insertions, 58 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);
diff --git a/src/powder.c b/src/powder.c
index ad3c9b6..aabe04f 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -2815,7 +2815,7 @@ void update_particles_i(pixel *vid, int start, int inc)
r = pmap[y+ny][x+nx];
if((r>>8)>=NPART || !r)
continue;
- if(parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB){
+ if(parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB && parts[r>>8].type!=PT_DMND && parts[r>>8].type!=PT_CLNE && parts[r>>8].type!=PT_PCLN && parts[r>>8].type!=PT_BCLN){
int rad = 8;
int nxi;
int nxj;
@@ -2834,16 +2834,17 @@ void update_particles_i(pixel *vid, int start, int inc)
}
for(nxj=-rad; nxj<=rad; nxj++)
for(nxi=-rad; nxi<=rad; nxi++)
- if((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1){
- delete_part(x+nxi, y+nxj);
- pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f;
- int nb = create_part(-1, x+nxi, y+nxj, PT_BOMB);
- if(nb!=-1){
- parts[nb].tmp = 2;
- parts[nb].life = 2;
- parts[nb].temp = MAX_TEMP;
+ if((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1)
+ if((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN){
+ delete_part(x+nxi, y+nxj);
+ pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f;
+ int nb = create_part(-1, x+nxi, y+nxj, PT_BOMB);
+ if(nb!=-1){
+ parts[nb].tmp = 2;
+ parts[nb].life = 2;
+ parts[nb].temp = MAX_TEMP;
+ }
}
- }
//create_parts(x, y, 9, 9, PT_BOMB);
//create_parts(x, y, 8, 8, PT_NONE);
parts[i].type = PT_NONE;