summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-08-12 15:34:20 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-08-12 15:34:20 (GMT)
commit62bd61edaebabe1b48c62826bd6634b2921ac40c (patch)
tree97cc17ff9e3f131fcef2a953d9a724e83ada2c18 /src
parent2d7c75c026be5d4d0833a285db0d6523b2e6f844 (diff)
downloadpowder-62bd61edaebabe1b48c62826bd6634b2921ac40c.zip
powder-62bd61edaebabe1b48c62826bd6634b2921ac40c.tar.gz
Better graphics for H2 and O2
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c77
1 files changed, 74 insertions, 3 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 7743f24..23ca82a 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1840,14 +1840,15 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
else if (cmode==CM_FANCY && //all fancy mode effects go here, this is a list of exceptions to skip
- t!=PT_FIRE && t!=PT_PLSM && t!=PT_WTRV &&
+ t!=PT_FIRE && t!=PT_PLSM && t!=PT_WTRV &&
t!=PT_HFLM && t!=PT_SPRK && t!=PT_FIRW &&
t!=PT_DUST && t!=PT_FIRW && t!=PT_FWRK &&
t!=PT_NEUT && t!=PT_LAVA && t!=PT_BOMB &&
t!=PT_PHOT && t!=PT_THDR && t!=PT_SMKE &&
t!=PT_LCRY && t!=PT_SWCH && t!=PT_PCLN &&
t!=PT_PUMP && t!=PT_HSWC && t!=PT_FILT &&
- t!=PT_GPMP && t!=PT_PBCN && t!=PT_LIFE)
+ t!=PT_GPMP && t!=PT_PBCN && t!=PT_LIFE &&
+ t!=PT_O2 && t!=PT_H2)
{
if (ptypes[parts[i].type].properties&TYPE_LIQUID) //special effects for liquids in fancy mode
{
@@ -2747,6 +2748,76 @@ void draw_parts(pixel *vid)
}
}
}
+ else if (t==PT_O2)
+ {
+ if (cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
+ {
+ x = nx/CELL;
+ y = ny/CELL;
+ cg = PIXG(ptypes[t].pcolors)/3;
+ cb = PIXB(ptypes[t].pcolors)/3;
+ cr = PIXR(ptypes[t].pcolors)/3;
+ cg += fire_g[y][x];
+ if (cg > PIXG(ptypes[t].pcolors)/2) cg = PIXG(ptypes[t].pcolors)/2;
+ fire_g[y][x] = cg;
+ cb += fire_b[y][x];
+ if (cb > PIXB(ptypes[t].pcolors)/2) cb = PIXB(ptypes[t].pcolors)/2;
+ fire_b[y][x] = cb;
+ cr += fire_r[y][x];
+ if (cr > PIXR(ptypes[t].pcolors)/2) cr = PIXR(ptypes[t].pcolors)/2;
+ fire_r[y][x] = cr;
+ }
+ else
+ {
+ for (x=-3; x<4; x++)
+ {
+ for (y=-3; y<4; y++)
+ {
+ if (abs(x)+abs(y) <2 && !(abs(x)==2||abs(y)==2))
+ blendpixel(vid,x+nx,y+ny, PIXR(ptypes[t].pcolors)/1.6, PIXG(ptypes[t].pcolors)/1.6, PIXB(ptypes[t].pcolors)/1.6, 30);
+ if (abs(x)+abs(y) <=3 && abs(x)+abs(y))
+ blendpixel(vid,x+nx,y+ny, PIXR(ptypes[t].pcolors)/1.6, PIXG(ptypes[t].pcolors)/1.6, PIXB(ptypes[t].pcolors)/1.6, 10);
+ if (abs(x)+abs(y) == 2)
+ blendpixel(vid,x+nx,y+ny, PIXR(ptypes[t].pcolors)/1.6, PIXG(ptypes[t].pcolors)/1.6, PIXB(ptypes[t].pcolors)/1.6, 20);
+ }
+ }
+ }
+ }
+ else if (t==PT_H2)
+ {
+ if (cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
+ {
+ x = nx/CELL;
+ y = ny/CELL;
+ cg = PIXG(ptypes[t].pcolors)/3;
+ cb = PIXB(ptypes[t].pcolors)/3;
+ cr = PIXR(ptypes[t].pcolors)/3;
+ cg += fire_g[y][x];
+ if (cg > PIXG(ptypes[t].pcolors)/2) cg = PIXG(ptypes[t].pcolors)/2;
+ fire_g[y][x] = cg;
+ cb += fire_b[y][x];
+ if (cb > PIXB(ptypes[t].pcolors)/2) cb = PIXB(ptypes[t].pcolors)/2;
+ fire_b[y][x] = cb;
+ cr += fire_r[y][x];
+ if (cr > PIXR(ptypes[t].pcolors)/2) cr = PIXR(ptypes[t].pcolors)/2;
+ fire_r[y][x] = cr;
+ }
+ else
+ {
+ for (x=-3; x<4; x++)
+ {
+ for (y=-3; y<4; y++)
+ {
+ if (abs(x)+abs(y) <2 && !(abs(x)==2||abs(y)==2))
+ blendpixel(vid,x+nx,y+ny, PIXR(ptypes[t].pcolors)/1.6, PIXG(ptypes[t].pcolors)/1.6, PIXB(ptypes[t].pcolors)/1.6, 30);
+ if (abs(x)+abs(y) <=3 && abs(x)+abs(y))
+ blendpixel(vid,x+nx,y+ny, PIXR(ptypes[t].pcolors)/1.6, PIXG(ptypes[t].pcolors)/1.6, PIXB(ptypes[t].pcolors)/1.6, 10);
+ if (abs(x)+abs(y) == 2)
+ blendpixel(vid,x+nx,y+ny, PIXR(ptypes[t].pcolors)/1.6, PIXG(ptypes[t].pcolors)/1.6, PIXB(ptypes[t].pcolors)/1.6, 20);
+ }
+ }
+ }
+ }
else if (t==PT_THDR)
{
if (cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
@@ -3344,7 +3415,7 @@ void draw_parts(pixel *vid)
}
}
//blob view!
- if (cmode == CM_BLOB&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)&&t!=PT_LIFE)
+ if (cmode == CM_BLOB&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)&&t!=PT_LIFE&&t!=PT_H2&&t!=PT_O2)
{
if (t==PT_PHOT) {
cg = 0;